List of usage examples for java.util EnumMap getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:de.javakaffee.kryoserializers.KryoTest.java
@Test(enabled = true) public void testEnumMap() throws Exception { final EnumMap<Gender, String> map = new EnumMap<Gender, String>(Gender.class); final String value = "foo"; map.put(Gender.FEMALE, value);// w ww .jav a 2 s . com // Another entry with the same value - to check reference handling map.put(Gender.MALE, value); @SuppressWarnings("unchecked") final EnumMap<Gender, String> deserialized = deserialize(serialize(map), map.getClass()); assertDeepEquals(deserialized, map); }