Skip to content

Instantly share code, notes, and snippets.

@DeepSpawn
Last active November 13, 2016 08:25
Show Gist options
  • Save DeepSpawn/42e5e0d56cf87562e1d65e2ea66419cc to your computer and use it in GitHub Desktop.
Save DeepSpawn/42e5e0d56cf87562e1d65e2ea66419cc to your computer and use it in GitHub Desktop.
class CustomVarargMatcher extends ArgumentMatcher<Object[]> implements VarargMatcher {
private String[] expectedValues;
CustomVarargMatcher(Object... expectedValues) {
this.expectedValues = expectedValues;
}
@Override
public boolean matches(Object varargArgument) {
return new EqualsBuilder()
.append(expectedValues, varargArgument)
.isEquals();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment