InvolvedTypeInspector { public ListOrderedSet<CtClass> inspect(CtClass type) throws NotFoundException { ListOrderedSet<CtClass> inheritedTypes = new ListOrderedSet<CtClass>(); inheritedTypes.add(type); if (type.getSuperclass() != null) { inheritedTypes.addAll(inspect(type.getSuperclass())); } for (CtClass interfaze : type.getInterfaces()) { inheritedTypes.addAll(inspect(interfaze)); } inheritedTypes.reverseOrder(); return inheritedTypes; }  ListOrderedSet<CtClass> inspect(CtClass type);  }
@Test public void testInspect() throws Exception { CtClass noSuperClass = pool.get(NoSuperClass.class.getName()); assertEquals(2, inspector.inspect(noSuperClass).size()); CtClass subClass = pool.get(SubClass.class.getName()); assertEquals(3, inspector.inspect(subClass).size()); }