Java tutorial
//package com.java2s; // The contents of this file are subject to the Mozilla Public License import javax.annotation.Nonnull; import java.util.*; public class Main { @Nonnull public static <K extends Enum<K>, V> Map<K, V> enumMap(Class<K> enumClass) { return new EnumMap<K, V>(enumClass); } }