Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy	(revision 8391)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy	(revision 8415)
@@ -140,5 +140,5 @@
         r.addMember(new RelationMember("another role", w3))
 
-        Environment e = new Environment().withPrimitive(r)
+        Environment e = new Environment(r)
         assert selector.matches(e)
     }
@@ -165,11 +165,11 @@
         r.addMember(new RelationMember("another role", w3))
 
-        Environment e = new Environment().withPrimitive(w1)
+        Environment e = new Environment(w1)
         assert !selector.matches(e)
 
-        e = new Environment().withPrimitive(w2)
+        e = new Environment(w2)
         assert !selector.matches(e)
 
-        e = new Environment().withPrimitive(w3)
+        e = new Environment(w3)
         assert selector.matches(e)
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy	(revision 8391)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy	(revision 8415)
@@ -77,5 +77,5 @@
         r.addMember(new RelationMember("my_role", n))
 
-        Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
+        Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
 
         Condition cond = Condition.createKeyCondition("my_role", false, null, Context.LINK)
@@ -92,5 +92,5 @@
         r.addMember(new RelationMember("my_role", n))
 
-        Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
+        Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
 
         Condition cond = Condition.createKeyCondition("another_role", false, null, Context.LINK)
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy	(revision 8391)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy	(revision 8415)
@@ -63,5 +63,5 @@
         r.addMember(new RelationMember("my_role", n))
 
-        Environment e = new Environment().withPrimitive(n).withParent(r).withLinkContext().withIndex(0, r.membersCount)
+        Environment e = new Environment(n).withParent(r).withLinkContext().withIndex(0, r.membersCount)
 
         Condition cond = new Condition.RoleCondition("my_role", Op.EQ)
@@ -78,5 +78,5 @@
         r.addMember(new RelationMember("my_role", n))
 
-        Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
+        Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
 
         Condition cond = Condition.createKeyValueCondition("role", "my_role", Op.NEQ, Context.LINK, false)
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy	(revision 8391)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy	(revision 8415)
@@ -19,5 +19,5 @@
 
     protected static Environment getEnvironment(String key, String value) {
-        return new Environment().withPrimitive(OsmUtils.createPrimitive("way " + key + "=" + value))
+        return new Environment(OsmUtils.createPrimitive("way " + key + "=" + value))
     }
 
@@ -192,10 +192,10 @@
     public void testNRegexKeyConditionSelector() throws Exception {
         def s1 = getParser("*[sport][tourism != hotel]").selector()
-        assert s1.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar")))
-        assert !s1.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
+        assert s1.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar")))
+        assert !s1.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
         def s2 = getParser("*[sport][tourism != hotel][leisure !~ /^(sports_centre|stadium|)\$/]").selector()
-        assert s2.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar")))
-        assert !s2.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
-        assert !s2.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar leisure=stadium")))
+        assert s2.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar")))
+        assert !s2.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
+        assert !s2.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar leisure=stadium")))
     }
 
@@ -206,15 +206,15 @@
         w1.put("foo", "123")
         w1.put("bar", "456")
-        assert !c1.applies(new Environment().withPrimitive(w1))
+        assert !c1.applies(new Environment(w1))
         w1.put("bar", "123")
-        assert c1.applies(new Environment().withPrimitive(w1))
+        assert c1.applies(new Environment(w1))
         def c2 = (Condition.KeyValueCondition) getParser("[foo =~ */bar/]").condition(Condition.Context.PRIMITIVE)
         def w2 = new Way(w1)
         w2.put("bar", "[0-9]{3}")
-        assert c2.applies(new Environment().withPrimitive(w2))
+        assert c2.applies(new Environment(w2))
         w2.put("bar", "[0-9]")
-        assert c2.applies(new Environment().withPrimitive(w2))
+        assert c2.applies(new Environment(w2))
         w2.put("bar", "^[0-9]\$")
-        assert !c2.applies(new Environment().withPrimitive(w2))
+        assert !c2.applies(new Environment(w2))
     }
 
@@ -301,11 +301,11 @@
         w.addNode(n2)
 
-        def e = new Environment().withPrimitive(n2)
+        def e = new Environment(n2)
         assert s1.matches(e)
         assert e.osm == n2
         assert e.child == n1
         assert e.parent == w
-        assert !s1.matches(new Environment().withPrimitive(n1))
-        assert !s1.matches(new Environment().withPrimitive(w))
+        assert !s1.matches(new Environment(n1))
+        assert !s1.matches(new Environment(w))
     }
 
@@ -332,10 +332,10 @@
         w.addNode(n3)
 
-        assert s1.right.matches(new Environment().withPrimitive(n3))
-        assert s1.left.matches(new Environment().withPrimitive(n2).withChild(n3).withParent(w))
-        assert s1.matches(new Environment().withPrimitive(n3))
-        assert !s1.matches(new Environment().withPrimitive(n1))
-        assert !s1.matches(new Environment().withPrimitive(n2))
-        assert !s1.matches(new Environment().withPrimitive(w))
+        assert s1.right.matches(new Environment(n3))
+        assert s1.left.matches(new Environment(n2).withChild(n3).withParent(w))
+        assert s1.matches(new Environment(n3))
+        assert !s1.matches(new Environment(n1))
+        assert !s1.matches(new Environment(n2))
+        assert !s1.matches(new Environment(w))
     }
 
