Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 3719)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 3796)
@@ -29,4 +29,13 @@
 
     /**
+     * for convenience: test whether 2 objects are either both null or a.equals(b)
+     */
+    public static <T> boolean equal(T a, T b) {
+        if (a == null && b == null)
+            return true;
+        return (a != null && a.equals(b));
+    }
+
+    /**
      * return the modulus in the range [0, n)
      */
