Bug 103089 [JUnit] Running JUnit tests constrained by package takes minutes to run on jumbos
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/TestSearchEngine.java
}
	private static void collectTypes(Object element, IProgressMonitor pm, Set result) throws CoreException {
		pm.beginTask(JUnitMessages.TestSearchEngine_message_searching, 10);  
	    element= computeScope(element);
	    try {
			while((element instanceof ISourceReference) && !(element instanceof ICompilationUnit)) {
				if(element instanceof IType) {
					if (hasSuiteMethod((IType)element) || isTestType((IType)element)) {
						result.add(element);
						return;
					}
				}
				element= ((IJavaElement)element).getParent();
			}
			if (element instanceof ICompilationUnit) {
				ICompilationUnit cu= (ICompilationUnit)element;
				IType[] types= cu.getAllTypes();
	
				for (int i= 0; i < types.length; i++) {
					if (hasSuiteMethod(types[i])  || isTestType(types[i]))
						result.add(types[i]);
				}
			} 
			else if (element instanceof IJavaElement) {
			    List testCases= findTestCases((IJavaElement)element, new SubProgressMonitor(pm, 7));
				List suiteMethods= searchSuiteMethods(new SubProgressMonitor(pm, 3), (IJavaElement)element);			
				while (!suiteMethods.isEmpty()) {
					if (!testCases.contains(suiteMethods.get(0))) {
						testCases.add(suiteMethods.get(0));
					}