GreaterThanValidationMatcher implements ValidationMatcher { public void validate(String fieldName, String value, List<String> controlParameters, TestContext context) throws ValidationException { String control = controlParameters.get(0); Double dValue; Double dControl; try { dValue = Double.parseDouble(value); dControl = Double.parseDouble(control); } catch (Exception e) { throw new ValidationException(this.getClass().getSimpleName() + " failed for field '" + fieldName + "'. Received value is '" + value + "', control value is '" + control + "'", e); } if (!(dValue > dControl)) { throw new ValidationException(this.getClass().getSimpleName() + " failed for field '" + fieldName + "'. Received value is '" + value + "', control value is '" + control + "'"); } }  void validate(String fieldName, String value, List<String> controlParameters, TestContext context);  }
@Test public void testValidateSuccess() { matcher.validate("field", "2", Arrays.asList("3"), context); matcher.validate("field", "-1", Arrays.asList("1"), context); matcher.validate("field", "-0.000000001", Arrays.asList("0"), context); matcher.validate("field", "0", Arrays.asList("0.000000001"), context); }