public static <E extends Enum<E>> Map<String, E> mapEnumNamesToValues(
      final String prefix,
      final Class<E> enumClass) {
    final E[] constants = enumClass.getEnumConstants();
    Map<String, E> mapping = new HashMap<>(constants.length);
    for (E constant : constants) {
      final String lc = constant.name().toLowerCase(Locale.ROOT);
      final E orig = mapping.put(prefix + lc, constant);
      checkArgument(orig == null,
          "Enum %s "
              + ERROR_MULTIPLE_ELEMENTS_MATCHING_TO_LOWER_CASE_VALUE
              + " %s",
          enumClass, lc);
    }
    return mapping;
  }
@Test
  public void testEmptyEnumMap() {
    Assertions.assertThat(mapEnumNamesToValues("", EmptyEnum.class))
        .isEmpty();
  }