{
try {
//search all the loaders for a class which we know we had in the address space
String candidateClass = this.getClass().getName()+"$Sub";
candidateClass = candidateClass.replace('.', '/');
JavaClass subclass = _findClassForName(candidateClass);
if (null == subclass) {
//not finding this testing class makes this test useless
//note that this can also happen if we are working with a corrupt core file
throw new TestNotImplementedException();
}
JavaClass superclass = null;
try {
superclass = subclass.getSuperclass();
} catch (CorruptDataException e) {
//even though this would be valid, it isn't helpful for our case
throw new TestNotImplementedException();
}
if (null == superclass) {
//not finding this testing class makes this test useless
throw new TestNotImplementedException();
}
//now make sure that none of the fields in subclass are in superclass
Iterator subfields = subclass.getDeclaredFields().iterator();
while (subfields.hasNext()) {
Object subtest = subfields.next();
Iterator superfields = superclass.getDeclaredFields().iterator();
while (superfields.hasNext()) {
Object supertest = superfields.next();
assertFalse(supertest.equals(subtest));
}