In this section, you will improve the code of the constructor of junit.framework.TestSuite. To make the intent of the code clearer, you will extract the code that collects test cases from base classes into a new method called collectInheritedTests.
Class superClass= theClass;
Vector names= new Vector();
while(Test.class.isAssignableFrom(superClass)) {
Method[] methods= superClass.getDeclaredMethods();
for (int i= 0; i < methods.length; i++) {
addTestMethod(methods[i],names, theClass);
}
superClass= superClass.getSuperclass();
}
Java editor
Refactoring support