Index: trunk/test/unit/org/openstreetmap/TestUtils.java
===================================================================
--- trunk/test/unit/org/openstreetmap/TestUtils.java	(revision 6562)
+++ trunk/test/unit/org/openstreetmap/TestUtils.java	(revision 6592)
@@ -2,10 +2,20 @@
 package org.openstreetmap;
 
-import org.junit.Ignore;
+import org.junit.Before;
+import org.junit.Test;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.tools.TextTagParser;
 
-@Ignore
+import java.util.Map;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
 public class TestUtils {
-    private TestUtils() {
-    }
 
     /**
@@ -20,3 +30,33 @@
         return testDataRoot.endsWith("/") ? testDataRoot : testDataRoot + "/";
     }
+
+    public static OsmPrimitive createPrimitive(String assertion) {
+        if (Main.pref == null) {
+            Main.initApplicationPreferences();
+        }
+        final String[] x = assertion.split("\\s+", 2);
+        final OsmPrimitive p = "n".equals(x[0]) || "node".equals(x[0])
+                ? new Node()
+                : "w".equals(x[0]) || "way".equals(x[0])
+                ? new Way()
+                : "r".equals(x[0]) || "relation".equals(x[0])
+                ? new Relation()
+                : null;
+        if (p == null) {
+            throw new IllegalArgumentException("Expecting n/node/w/way/r/relation, but got " + x[0]);
+        }
+        for (final Map.Entry<String, String> i : TextTagParser.readTagsFromText(x[1]).entrySet()) {
+            p.put(i.getKey(), i.getValue());
+        }
+        return p;
+    }
+
+    @Test
+    public void testCreatePrimitive() throws Exception {
+        final OsmPrimitive p = createPrimitive("way name=Foo railway=rail");
+        assertTrue(p instanceof Way);
+        assertThat(p.keySet().size(), is(2));
+        assertThat(p.get("name"), is("Foo"));
+        assertThat(p.get("railway"), is("rail"));
+    }
 }
