@Test
public void testBehavior() {

  TypeMap<String> registry = new GraphTypeMap<>();
  registry.safePut(Object.class, "OBJECT");
  registry.safePut(GraphTypeMapTest.class, "TEST");
  registry.safePut(CharSequence.class, "CHARSEQUENCE");
  registry.safePut(Serializable.class, "SERIALIZABLE");
  registry.safePut(Deque.class, "DEQUE");
  registry.safePut(Collection.class, "COLLECTION");
  Assert.assertEquals("TEST", registry.get(GraphTypeMapTest.class));
  Assert.assertEquals("OBJECT", registry.get(Object.class));
  try {
    registry.get(String.class);
    Assert.fail();
  } catch (IllegalArgumentException ex) {
    // expected
  }
  Assert.assertThat(registry.getAll(String.class), Matchers.hasItems("SERIALIZABLE", "CHARSEQUENCE"));
  Assert.assertEquals("SERIALIZABLE", registry.get(HostAndPort.class));
  Assert.assertEquals("SERIALIZABLE", registry.get(ColumnDef.class));
  Assert.assertThat(registry.getAll(ArrayDeque.class), Matchers.hasItems("SERIALIZABLE", "DEQUE"));
}