private static List<String> extractEnumValues(ResolvedType enumType, Function<Enum<?>, String> enumConstantToString) {
        Class<?> erasedType = enumType.getErasedType();
        if (Util.isNullOrEmpty(erasedType.getEnumConstants())) {
            return null;
        }
        return Stream.of(erasedType.getEnumConstants())
                .map(enumConstant -> enumConstantToString.apply((Enum<?>) enumConstant))
                .distinct()
                .collect(Collectors.toList());
    }
Look-up the given enum type's constant values.

@param enumType targeted enum type
@param enumConstantToString how to derive a plain string representation from an enum constant value
@return collection containing constant enum values
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/module/EnumModule.java