Change the signature of your method enumToMapto the following:
private static <E extends Enum<E>> Map<E, String> enumToMap(Class<E> enumType)
Then you call e.values()instead enumType.getEnumConstants().
In your main method, you can call this method as follows:
Map<testenum, String> map = enumToMap(testenum.class);
seanizer EnumMap Map, HashMap.