Enumeration nestedTests = suite.tests();
while (nestedTests.hasMoreElements()) {
tests.addAll(getTests((Test) nestedTests.nextElement()));
}
} else if (TestSetup.class.isAssignableFrom(test.getClass())) {
TestSetup setup = (TestSetup) test;
tests.addAll(getTests(setup.getTest()));
} else if (AbstractXWikiTestCase.class.isAssignableFrom(test.getClass())) {
tests.add((AbstractXWikiTestCase) test);
}
return tests;