EnumValuePropertyValidator implements PropertyValidator { @Override public ValidationResult validate(final Object value) { return validator.validate(value); } @SuppressWarnings("unchecked")  EnumValuePropertyValidator(final T[] values); @Override ValidationResult validate(final Object value); static String format(final T value); static String parseString(final Object value);  }
@Test public void testValues() { ConstrainedValuesValidatorTest.assertResultSuccess(tested.validate(PropertyValidatorEnum.VALUE1)); ConstrainedValuesValidatorTest.assertResultSuccess(tested.validate(PropertyValidatorEnum.VALUE2)); ConstrainedValuesValidatorTest.assertResultSuccess(tested.validate(PropertyValidatorEnum.VALUE1)); ConstrainedValuesValidatorTest.assertResultFailed(tested.validate("value4")); }