TypeHierarchy { public boolean isA(String type, String supertype) { Set<String> supertypes = getSupertypes(type); return type.equals(supertype) || supertypes.contains(supertype); } protected  TypeHierarchy(); boolean isA(String type, String supertype);  }
@Test public void intIsALong() throws Exception { TypeHierarchy hierarchy = new TypeHierarchy(); assertTrue(hierarchy.isA("int", "long")); }
@Test public void intIsNotAString() throws Exception { TypeHierarchy hierarchy = new TypeHierarchy(); assertFalse(hierarchy.isA("int", "String")); }
@Test public void reflexive() throws Exception { TypeHierarchy hierarchy = new TypeHierarchy(); assertTrue(hierarchy.isA("A", "A")); }