List<Test> (Test test) { List<Test> testCases = new ArrayList<>(); if (test instanceof TestRunnerUtil.SuiteMethodWrapper) { test = ((TestRunnerUtil.SuiteMethodWrapper)test).getSuite(); } if (test instanceof TestSuite) { TestSuite testSuite = (TestSuite)test; for (Enumeration<Test> each = testSuite.tests(); each.hasMoreElements();) { Test childTest = each.nextElement(); if (childTest instanceof TestSuite && !((TestSuite)childTest).tests().hasMoreElements()) continue; testCases.add(childTest); } } return testCases; }