CoordinatesValidator implements ConstraintValidator<ValidCoordinates, RectangularBox> { @Override public boolean isValid(RectangularBox value, ConstraintValidatorContext context) { if (value != null) { return value.getTop() > value.getBottom() && value.getRight() > value.getLeft(); } return true; }  @Override void initialize(ValidCoordinates constraintAnnotation); @Override boolean isValid(RectangularBox value, ConstraintValidatorContext context);  }
@Test public void testNull() { assertTrue(victim.isValid(null, null)); }
@Test public void testLeftGreater() { TestUtils.setProperty(box, "left", 11); assertFalse(victim.isValid(box, null)); }
@Test public void testBottomGreater() { TestUtils.setProperty(box, "bottom", 11); assertFalse(victim.isValid(box, null)); }
@Test public void testValid() { assertTrue(victim.isValid(box, null)); }