Index: trunk/test/unit/org/openstreetmap/TestUtils.java
===================================================================
--- trunk/test/unit/org/openstreetmap/TestUtils.java	(revision 6573)
+++ 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"));
+    }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.groovy
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.groovy	(revision 6592)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.groovy	(revision 6592)
@@ -0,0 +1,41 @@
+package org.openstreetmap.josm.data.validation.tests
+
+import org.openstreetmap.TestUtils
+
+class LanesTest extends GroovyTestCase {
+
+    def lanes = new Lanes()
+
+    @Override
+    void setUp() {
+        lanes.initialize()
+        lanes.startTest(null)
+    }
+
+    void testLanesCount() {
+        assert lanes.getLanesCount("") == 0
+        assert lanes.getLanesCount("left") == 1
+        assert lanes.getLanesCount("left|right") == 2
+        assert lanes.getLanesCount("yes|no|yes") == 3
+    }
+
+    void test1() {
+        lanes.check(TestUtils.createPrimitive("way turn:lanes=left|right change:lanes=only_left|not_right|yes"))
+        assert lanes.errors.get(0).getMessage() == "Number of lane dependent values inconsistent"
+    }
+
+    void test2() {
+        lanes.check(TestUtils.createPrimitive("way width:lanes:forward=1|2|3 psv:lanes:forward=no|designated"))
+        assert lanes.errors.get(0).getMessage() == "Number of lane dependent values inconsistent in forward direction"
+    }
+
+    void test3() {
+        lanes.check(TestUtils.createPrimitive("way change:lanes:forward=yes|no turn:lanes:backward=left|right|left"))
+        assert lanes.errors.isEmpty()
+    }
+
+    void test4() {
+        lanes.check(TestUtils.createPrimitive("way turn:lanes:forward=left|right change:lanes:forward=yes|no|yes width:backward=1|2|3"))
+        assert lanes.errors.get(0).getMessage() == "Number of lane dependent values inconsistent in forward direction"
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 6573)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 6592)
@@ -3,4 +3,5 @@
 import org.junit.Before;
 import org.junit.Test;
+import org.openstreetmap.TestUtils;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
@@ -65,34 +66,7 @@
     }
 
-    OsmPrimitive createPrimitiveForAssertion(String assertion) {
-        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 testCreatePrimitiveForAssertion() throws Exception {
-        final OsmPrimitive p = createPrimitiveForAssertion("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"));
-    }
-
     @Test(expected = IllegalArgumentException.class)
     public void testCreatePrimitiveForAssertionFail() throws Exception {
-        final OsmPrimitive p = createPrimitiveForAssertion("noway name=Foo");
+        final OsmPrimitive p = TestUtils.createPrimitive("noway name=Foo");
     }
 
@@ -105,5 +79,5 @@
         for (final MapCSSTagChecker.TagCheck check : c.checks) {
             for (final Map.Entry<String, Boolean> i : check.assertions.entrySet()) {
-                final OsmPrimitive p = createPrimitiveForAssertion(i.getKey());
+                final OsmPrimitive p = TestUtils.createPrimitive(i.getKey());
                 if (check.matchesPrimitive(p) != i.getValue()) {
                     final String error = MessageFormat.format("Expecting test ''{0}'' (i.e., {1}) to {2} {3} (i.e., {4})",
