TypeMap { public Class<?> typeFor(String typeName) { return typesByName.get(typeName); } TypeMap(int initialSize);  TypeMap(Class<?>... types); @SuppressWarnings("PMD.CompareObjectsWithEquals") void add(Class<?> type); boolean contains(Class<?> type); boolean contains(String typeName); Class<?> typeFor(String typeName); void add(Class<?>... types); Map<Class<?>, String> asInverseWithShortName(); int size();  }
@Test public void testTypeFor() { TypeMap map = new TypeMap(2); map.add(String.class); map.add(List.class); Assert.assertTrue(map.typeFor("String") == String.class); Assert.assertTrue(map.typeFor("java.lang.String") == String.class); Assert.assertTrue(map.typeFor("List") == List.class); Assert.assertTrue(map.typeFor("java.util.List") == List.class); }