@Test public void matchesListOfArguments() { List<ArgumentMatcher<?>> arguments = Arrays.asList( new EqualsMatcher<>(intValue), new EqualsMatcher<>(stringValue), new EqualsMatcher<>(nullValue) ); assertTrue(new Arguments(arguments).matches(1, stringValue, nullValue)); }
public boolean matches(Object... arguments) { int length = argumentMatchers.size(); if (length != arguments.length) return false; else for (int i = 0; i < length; i++) { ArgumentMatcher matcher = argumentMatchers.get(i); @SuppressWarnings("unchecked") boolean matches = matcher.matches(arguments[i]); if (!matches) return false; } return true; }
Arguments { public boolean matches(Object... arguments) { int length = argumentMatchers.size(); if (length != arguments.length) return false; else for (int i = 0; i < length; i++) { ArgumentMatcher matcher = argumentMatchers.get(i); @SuppressWarnings("unchecked") boolean matches = matcher.matches(arguments[i]); if (!matches) return false; } return true; } }
Arguments { public boolean matches(Object... arguments) { int length = argumentMatchers.size(); if (length != arguments.length) return false; else for (int i = 0; i < length; i++) { ArgumentMatcher matcher = argumentMatchers.get(i); @SuppressWarnings("unchecked") boolean matches = matcher.matches(arguments[i]); if (!matches) return false; } return true; } Arguments(List<ArgumentMatcher<?>> argumentMatchers); }
Arguments { public boolean matches(Object... arguments) { int length = argumentMatchers.size(); if (length != arguments.length) return false; else for (int i = 0; i < length; i++) { ArgumentMatcher matcher = argumentMatchers.get(i); @SuppressWarnings("unchecked") boolean matches = matcher.matches(arguments[i]); if (!matches) return false; } return true; } Arguments(List<ArgumentMatcher<?>> argumentMatchers); boolean matches(Object... arguments); List<ArgumentMatcher<?>> getArgumentMatchers(); @Override boolean equals(Object o); @Override int hashCode(); }
Arguments { public boolean matches(Object... arguments) { int length = argumentMatchers.size(); if (length != arguments.length) return false; else for (int i = 0; i < length; i++) { ArgumentMatcher matcher = argumentMatchers.get(i); @SuppressWarnings("unchecked") boolean matches = matcher.matches(arguments[i]); if (!matches) return false; } return true; } Arguments(List<ArgumentMatcher<?>> argumentMatchers); boolean matches(Object... arguments); List<ArgumentMatcher<?>> getArgumentMatchers(); @Override boolean equals(Object o); @Override int hashCode();  }