Set declaredSubtypeNames = asSetOfNames(type.getDeclaredSubtypes());
Set subtypeNames = asSetOfNames(type.getSubtypes());
assertTrue("all declared subtypes must be subtypes: "
+ (new HashSet(declaredSubtypeNames).removeAll(subtypeNames)),
subtypeNames.containsAll(declaredSubtypeNames));
// check the reverse relation
for (Iterator it = subtypeNames.iterator(); it.hasNext(); ) {
String subtypename = (String) it.next();
boolean isDeclared = declaredSubtypeNames.contains(subtypename);