Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 10296)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 10297)
@@ -17,4 +17,5 @@
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -87,9 +88,14 @@
 
     /**
-     * All available tests
-     * TODO: is there any way to find out automatically all available tests?
+     * All registered tests
+     */
+    private static final Collection<Class<? extends Test>> allTests = new ArrayList<>();
+    private static final Map<String, Test> allTestsMap = new HashMap<>();
+
+    /**
+     * All available tests in core
      */
     @SuppressWarnings("unchecked")
-    private static final Class<Test>[] allAvailableTests = new Class[] {
+    private static final Class<Test>[] CORE_TEST_CLASSES = new Class[] {
         /* FIXME - unique error numbers for tests aren't properly unique - ignoring will not work as expected */
         DuplicateNode.class, // ID    1 ..   99
@@ -133,13 +139,16 @@
     };
 
-    private static Map<String, Test> allTestsMap;
+    public static void addTest(Class<? extends Test> testClass) {
+        allTests.add(testClass);
+        try {
+            allTestsMap.put(testClass.getName(), testClass.getConstructor().newInstance());
+        } catch (ReflectiveOperationException e) {
+            Main.error(e);
+        }
+    }
+
     static {
-        allTestsMap = new HashMap<>();
-        for (Class<Test> testClass : allAvailableTests) {
-            try {
-                allTestsMap.put(testClass.getName(), testClass.getConstructor().newInstance());
-            } catch (ReflectiveOperationException e) {
-                Main.error(e);
-            }
+        for (Class<? extends Test> testClass : CORE_TEST_CLASSES) {
+            addTest(testClass);
         }
     }
@@ -274,8 +283,8 @@
      * Gets the list of all available test classes
      *
-     * @return An array of the test classes
-     */
-    public static Class<Test>[] getAllAvailableTests() {
-        return Utils.copyArray(allAvailableTests);
+     * @return A collection of the test classes
+     */
+    public static Collection<Class<? extends Test>> getAllAvailableTestClasses() {
+        return Collections.unmodifiableCollection(allTests);
     }
 
