(Map<K, ?> map)
| 86 | |
| 87 | |
| 88 | static <K extends Enum<K>> Class<K> inferKeyType(Map<K, ?> map) { |
| 89 | if (map instanceof EnumBiMap) { |
| 90 | return ((EnumBiMap<K, ?>) map).keyType(); |
| 91 | } |
| 92 | if (map instanceof EnumHashBiMap) { |
| 93 | return ((EnumHashBiMap<K, ?>) map).keyType(); |
| 94 | } |
| 95 | checkArgument(!map.isEmpty()); |
| 96 | return map.keySet().iterator().next().getDeclaringClass(); |
| 97 | } |
| 98 | |
| 99 | private static <V extends Enum<V>> Class<V> inferValueType(Map<?, V> map) { |
| 100 | if (map instanceof EnumBiMap) { |
no test coverage detected