@SuppressWarnings("unchecked")
    public static <T> Map<String, T> getEnumConstants(Class<T> type) {
        return Arrays.stream(type.getDeclaredFields())
                .filter(field -> field.getType() == type
                        && (field.getModifiers() & ENUM_CONSTANT_MASK) == ENUM_CONSTANT_MASK)
                .collect(toMap(Field::getName, field -> {
                    try {
                        return (T) field.get(null);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }
                }));
    }
@Test
    public void test_getEnumConstants() {
        assertThat(FieldUtils.getEnumConstants(EnumLikeClass.class))
                .containsExactlyInAnyOrderEntriesOf(Map.of(
                        "VALUE1", EnumLikeClass.VALUE1,
                        "VALUE2", EnumLikeClass.VALUE2,
                        "VALUE3", EnumLikeClass.VALUE3
                ));
    }