private Class<?> enumClass(Column column, Class<?> entityType) {
        return EnumGeneratorUtil.classesIn(entityType)

            // Include only enum subclasses
            .filter(Enum.class::isAssignableFrom)

            // Include only enums with the correct name
            .filter(c -> c.getSimpleName().equalsIgnoreCase(
                column.getJavaName().replace("_", "")
            ))

            // Include only enums with a method called fromDatabase()
            // that takes the right parameters
            .filter(c -> Stream.of(c.getMethods())
                .filter(m -> m.getName().equals(FROM_DATABASE_METHOD))
                .anyMatch(m -> {
                    final Class<?>[] params = m.getParameterTypes();
                    return params.length == 1
                        && params[0] == column.findDatabaseType();
                })
            )

            // Return it as the enumClass or throw an exception.
            .findAny()
                .orElseThrow(() -> new NoSuchElementException("No enum class with a '" + FROM_DATABASE_METHOD +
                        "' method found for " + column.getId() + " entityType " + entityType));

    }
@param <T>  the enum type

@author  Emil Forslund
@author  Simon Jonasson
@since   3.0.0
plugin-parent/enum-generator/src/main/java/com/speedment/plugins/enums/StringToEnumTypeMapper.java