### Question:
Xsd2UmlLookup { public Identifier from(final T key) { if (key == null) { throw new IllegalArgumentException("name"); } if (data.containsKey(key)) { return data.get(key); } else { final Identifier reference = Identifier.random(); data.put(key, reference); return reference; } }  Identifier from(final T key);  }### Answer:
@Test public void testFrom() throws Exception { ClassType classType = Mockito.mock(ClassType.class); Identifier id = testObject.from(classType); Assert.assertNotNull(id); Identifier dupId = testObject.from(classType); Assert.assertEquals(id, dupId); }
@Test(expected = IllegalArgumentException.class) public void testFormQualifiedName() throws Exception { testObject.from(null); }