### Question:
DoubleRangeValidator extends CustomValidator<Double> { public static DoubleRangeValidator upTo(double max, String errorMessage) { return new DoubleRangeValidator(Double.MIN_VALUE, max, errorMessage); } private  DoubleRangeValidator(double min, double max, String errorMessage); static DoubleRangeValidator between(double min, double max, String errorMessage); static DoubleRangeValidator atLeast(double min, String errorMessage); static DoubleRangeValidator upTo(double max, String errorMessage); static DoubleRangeValidator exactly(double value, String errorMessage);  }### Answer:
@Test public void upToTest() { DoubleRangeValidator i = DoubleRangeValidator.upTo(3.14, "test"); Assert.assertFalse(i.validate(-1.14).getResult()); Assert.assertFalse(i.validate(5.13).getResult()); Assert.assertTrue(i.validate(3.14).getResult()); Assert.assertFalse(i.validate(3.141).getResult()); Assert.assertTrue(i.validate(Double.MIN_VALUE).getResult()); }