testing: generics
diff --git a/core/plugins/org.eclipse.dltk.testing/build.properties b/core/plugins/org.eclipse.dltk.testing/build.properties
index 4c558d0..71ac9fc 100755
--- a/core/plugins/org.eclipse.dltk.testing/build.properties
+++ b/core/plugins/org.eclipse.dltk.testing/build.properties
@@ -8,6 +8,7 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
+additional.bundles=org.eclipse.dltk.annotations
 bin.includes = plugin.xml,\
                about.html,\
                icons/,\
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/TestCategoryEngineManager.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/TestCategoryEngineManager.java
index 2bb123c..8956b7c 100644
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/TestCategoryEngineManager.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/TestCategoryEngineManager.java
@@ -18,6 +18,7 @@
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.dltk.annotations.Nullable;
 import org.eclipse.dltk.internal.testing.launcher.NullTestRunnerUI;
 import org.eclipse.dltk.internal.testing.util.NumberUtils;
 import org.eclipse.dltk.testing.DLTKTestingPlugin;
@@ -25,7 +26,8 @@
 import org.eclipse.dltk.testing.ITestRunnerUI;
 import org.eclipse.dltk.utils.NatureExtensionManager;
 
-public class TestCategoryEngineManager extends NatureExtensionManager {
+public class TestCategoryEngineManager extends
+		NatureExtensionManager<TestCategoryEngineManager.Descriptor> {
 
 	private static final String EXTENSION_POINT = DLTKTestingPlugin.PLUGIN_ID
 			+ ".categoryEngine"; //$NON-NLS-1$
@@ -34,7 +36,7 @@
 		return "testingEngineId"; //$NON-NLS-1$
 	}
 
-	private static class Descriptor {
+	static class Descriptor {
 
 		final IConfigurationElement element;
 		final int priority;
@@ -62,7 +64,7 @@
 		return new Descriptor(confElement, priority);
 	}
 
-	private final Comparator descriptorComparator = new Comparator() {
+	private final Comparator<Object> descriptorComparator = new Comparator<Object>() {
 
 		public int compare(Object o1, Object o2) {
 			Descriptor descriptor1 = (Descriptor) o1;
@@ -72,7 +74,7 @@
 
 	};
 
-	protected void initializeDescriptors(List descriptors) {
+	protected void initializeDescriptors(List<Object> descriptors) {
 		Collections.sort(descriptors, descriptorComparator);
 	}
 
@@ -81,7 +83,7 @@
 		return descriptor;
 	}
 
-	protected Object[] createEmptyResult() {
+	protected Descriptor[] createEmptyResult() {
 		return new Descriptor[0];
 	}
 
@@ -101,17 +103,19 @@
 	 * @param runnerUI
 	 * @return
 	 */
+	@Nullable
 	public static ITestCategoryEngine[] getCategoryEngines(
 			ITestRunnerUI runnerUI) {
 		if (runnerUI instanceof NullTestRunnerUI) {
 			return null;
 		}
-		final Descriptor[] descriptors = (Descriptor[]) getInstance()
-				.getInstances(runnerUI.getTestingEngine().getId());
+		final Descriptor[] descriptors = getInstance().getInstances(
+				runnerUI.getTestingEngine().getId());
 		if (descriptors == null) {
 			return null;
 		}
-		final List result = new ArrayList(descriptors.length);
+		final List<ITestCategoryEngine> result = new ArrayList<ITestCategoryEngine>(
+				descriptors.length);
 		for (int i = 0; i < descriptors.length; ++i) {
 			final Descriptor descriptor = descriptors[i];
 			ITestCategoryEngine categoryEngine;
@@ -130,8 +134,7 @@
 		if (result.isEmpty()) {
 			return null;
 		} else {
-			return (ITestCategoryEngine[]) result
-					.toArray(new ITestCategoryEngine[result.size()]);
+			return result.toArray(new ITestCategoryEngine[result.size()]);
 		}
 	}
 }