NotAllowedValidator implements ConstraintValidator<NotAllowed, PredefinedSetOfPages> { @Override public boolean isValid(PredefinedSetOfPages value, ConstraintValidatorContext context) { if (value != null && disallow != null) { return !Arrays.asList(disallow).contains(value); } return true; }  @Override void initialize(NotAllowed constraintAnnotation); @Override boolean isValid(PredefinedSetOfPages value, ConstraintValidatorContext context);  }
@Test public void testNull() { assertTrue(victim.isValid(null, null)); }
@Test public void testDisallow() { assertFalse(victim.isValid(PredefinedSetOfPages.ALL_PAGES, null)); }