AbstractUnaryMatcher implements Matcher { @Override public final boolean matches(Parameter parameter, Object value, Object... properties) { if (properties.length != 0) { throw new InvalidArgumentException( "This operator does not take any operands: " + parameter.getOperator().getName() + " at " + parameter.getPath()); } return matches(value); }  @Override final boolean matches(Parameter parameter, Object value, Object... properties); @Override boolean isApplicableTo(Class<?> parameterType, Class<?>... propertiesTypes);  }
@Test(expectedExceptions = InvalidArgumentException.class, expectedExceptionsMessageRegExp = ".*x.y.z.*") public void testWhenHasParameters() { final NotMatchingUnaryMatcher matcher = new NotMatchingUnaryMatcher(); matcher.matches(new ImmutableParameter("x.y.z", null, null, new ImmutableOperator("sample operator", 0, null)), new Object(), new Object()); }
@Test public void testWhenHasNoParameters() { final NotMatchingUnaryMatcher matcher = new NotMatchingUnaryMatcher(); matcher.matches(new ImmutableParameter("x.y.z", null, null, null), new Object()); }