public static <T extends Enum<T>> Validator enumValues(final Class<T> enumClass) {
    final String[] enumValues = EnumSet.allOf(enumClass)
        .stream()
        .map(Object::toString)
        .toArray(String[]::new);

    final String[] validValues = Arrays.copyOf(enumValues, enumValues.length + 1);
    validValues[enumValues.length] = null;

    return ValidCaseInsensitiveString.in(validValues);
  }
@Test
  public void shouldNotThrowIfAValidEnumValueInDifferentCase() {
    // Given:
    final Validator validator = ConfigValidators.enumValues(TestEnum.class);

    // When:
    validator.ensureValid("propName", TestEnum.FOO.toString().toLowerCase());

    // Then: did not throw
  }