Index: /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilderTest.groovy
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilderTest.groovy	(revision 32408)
+++ /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilderTest.groovy	(revision 32409)
@@ -1,22 +1,18 @@
 package org.openstreetmap.josm.plugins.turnrestrictions;
 
-import java.util.Arrays;
-
-import groovy.util.GroovyTestCase;
-
-import static org.junit.Assert.*;
-import org.junit.*;
-import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.data.osm.RelationMember;
-import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.data.coor.LatLon;
+import static org.junit.Assert.*
 import static org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder.*
+
+import org.junit.*
+import org.openstreetmap.josm.data.coor.LatLon
+import org.openstreetmap.josm.data.osm.Node
+import org.openstreetmap.josm.data.osm.Relation
+import org.openstreetmap.josm.data.osm.RelationMember
+import org.openstreetmap.josm.data.osm.Way
 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionType
-import org.openstreetmap.josm.testutils.JOSMTestRules;;
+import org.openstreetmap.josm.testutils.JOSMTestRules
 
 class TurnRestrictionBuilderTest{
-	
+
     @Rule
     public JOSMTestRules rules = new JOSMTestRules().preferences();
@@ -24,86 +20,86 @@
     def TurnRestrictionBuilder builder = new TurnRestrictionBuilder();
 
-	def boolean hasExactlyOneMemberWithRole(Relation r, String role ){
-		return r.getMembers().find {RelationMember rm -> rm.getRole() == role} != null
-	}
-	
-	def memberWithRole(Relation r, String role) {
-		def RelationMember rm = r.getMembers().find {RelationMember rm -> rm.getRole() == role}
-		return rm.getMember()
-	}
-	
-	def void assertEmptyTurnRestriction(Relation r){
-		assert r != null
-		assert r.get("type") == "restriction"
-		assert r.getMembersCount() == 0
-	}
-	
-	/**
-	 * Selection consist of one way and the start node of the way ->
-	 * propose a No-U-Turn restriction
-	 * 		
-	 */
-	@Test
-	public void noUTurn_1() {
-		Way w = new Way(1)
-		Node n1 = new Node(1)
-		Node n2 = new Node(2)
-		w.setNodes([n1,n2])
-		
-		def sel = [w,n1]
-		TurnRestrictionBuilder builder = new TurnRestrictionBuilder()
-		Relation r = builder.build(sel)  
-		
-		assert r != null
-		assert r.getMembersCount() == 3
-		assert hasExactlyOneMemberWithRole(r, "from")
-		assert hasExactlyOneMemberWithRole(r, "to")
-		assert hasExactlyOneMemberWithRole(r, "via")
-		assert memberWithRole(r, "from") == w
-		assert memberWithRole(r, "to") == w
-		assert memberWithRole(r, "via") == n1
-		assert r.get("restriction") == "no_u_turn"			
-	}
-	
-	
-	/**
-	* Selection consist of one way and the end node of the way ->
-	* propose a No-U-Turn restriction
-	*
-	*/
+    def boolean hasExactlyOneMemberWithRole(Relation r, String role ){
+        return r.getMembers().find {RelationMember rm -> rm.getRole() == role} != null
+    }
+
+    def memberWithRole(Relation r, String role) {
+        def RelationMember rm = r.getMembers().find {RelationMember rm -> rm.getRole() == role}
+        return rm.getMember()
+    }
+
+    def void assertEmptyTurnRestriction(Relation r){
+        assert r != null
+        assert r.get("type") == "restriction"
+        assert r.getMembersCount() == 0
+    }
+
+    /**
+     * Selection consist of one way and the start node of the way ->
+     * propose a No-U-Turn restriction
+     *
+     */
+    @Test
+    public void noUTurn_1() {
+        Way w = new Way(1)
+        Node n1 = new Node(1)
+        Node n2 = new Node(2)
+        w.setNodes([n1,n2])
+
+        def sel = [w,n1]
+        TurnRestrictionBuilder builder = new TurnRestrictionBuilder()
+        Relation r = builder.build(sel)
+
+        assert r != null
+        assert r.getMembersCount() == 3
+        assert hasExactlyOneMemberWithRole(r, "from")
+        assert hasExactlyOneMemberWithRole(r, "to")
+        assert hasExactlyOneMemberWithRole(r, "via")
+        assert memberWithRole(r, "from") == w
+        assert memberWithRole(r, "to") == w
+        assert memberWithRole(r, "via") == n1
+        assert r.get("restriction") == "no_u_turn"
+    }
+
+
+    /**
+    * Selection consist of one way and the end node of the way ->
+    * propose a No-U-Turn restriction
+    *
+    */
    @Test
    public void noUTurn_2() {
-	   Way w = new Way(1)
-	   Node n1 = new Node(1)
-	   Node n2 = new Node(2)
-	   w.setNodes([n1,n2])
-	   
-	   def sel = [w,n2]
-	   TurnRestrictionBuilder builder = new TurnRestrictionBuilder()
-	   Relation r = builder.build(sel)
-	   
-	   assert r != null
-	   assert r.getMembersCount() == 3
-	   assert hasExactlyOneMemberWithRole(r, "from")
-	   assert hasExactlyOneMemberWithRole(r, "to")
-	   assert hasExactlyOneMemberWithRole(r, "via")
-	   assert memberWithRole(r, "from") == w
-	   assert memberWithRole(r, "to") == w
-	   assert memberWithRole(r, "via") == n2
-	   assert r.get("restriction") == "no_u_turn"
-   }
-   
+       Way w = new Way(1)
+       Node n1 = new Node(1)
+       Node n2 = new Node(2)
+       w.setNodes([n1,n2])
+
+       def sel = [w,n2]
+       TurnRestrictionBuilder builder = new TurnRestrictionBuilder()
+       Relation r = builder.build(sel)
+
+       assert r != null
+       assert r.getMembersCount() == 3
+       assert hasExactlyOneMemberWithRole(r, "from")
+       assert hasExactlyOneMemberWithRole(r, "to")
+       assert hasExactlyOneMemberWithRole(r, "via")
+       assert memberWithRole(r, "from") == w
+       assert memberWithRole(r, "to") == w
+       assert memberWithRole(r, "via") == n2
+       assert r.get("restriction") == "no_u_turn"
+   }
+
    @Test
    public void nullSelection() {
-	   def tr = builder.build(null)
-	   assertEmptyTurnRestriction(tr)
-   }
-   
+       def tr = builder.build(null)
+       assertEmptyTurnRestriction(tr)
+   }
+
    @Test
    public void emptySelection() {
-	   def tr = builder.build([])
-	   assertEmptyTurnRestriction(tr)
-   }
-   
+       def tr = builder.build([])
+       assertEmptyTurnRestriction(tr)
+   }
+
    /**
     * One selected way -> build a turn restriction with a "from" leg
@@ -112,12 +108,12 @@
    @Test
    public void oneSelectedWay() {
-	   Way w = new Way(1)
-	   Relation tr = builder.build([w])
-	   assert tr != null
-	   assert tr.get("type") == "restriction"
-	   assert tr.getMembersCount() == 1
-	   assert memberWithRole(tr, "from") == w
-   }   
-   
+       Way w = new Way(1)
+       Relation tr = builder.build([w])
+       assert tr != null
+       assert tr.get("type") == "restriction"
+       assert tr.getMembersCount() == 1
+       assert memberWithRole(tr, "from") == w
+   }
+
    /**
     * Two unconnected ways in the selection. The first one becomes the from leg,
@@ -126,24 +122,24 @@
    @Test
    public void twoUnconnectedWays() {
-	   Way w1 = new Way(1)
-	   w1.setNodes([new Node(11), new Node(12)])
-	   Way w2 = new Way(2)
-	   w2.setNodes([new Node(21), new Node(22)])
-	   
-	   Relation tr = builder.build([w1,w2])
-	   assert tr != null
-	   assert tr.get("type") == "restriction"
-	   assert ! tr.hasKey("restriction")
-	   assert tr.getMembersCount() == 2
-	   assert memberWithRole(tr, "from") == w1
-	   assert memberWithRole(tr, "to") == w2
-   }
-   
+       Way w1 = new Way(1)
+       w1.setNodes([new Node(11), new Node(12)])
+       Way w2 = new Way(2)
+       w2.setNodes([new Node(21), new Node(22)])
+
+       Relation tr = builder.build([w1,w2])
+       assert tr != null
+       assert tr.get("type") == "restriction"
+       assert ! tr.hasKey("restriction")
+       assert tr.getMembersCount() == 2
+       assert memberWithRole(tr, "from") == w1
+       assert memberWithRole(tr, "to") == w2
+   }
+
    /**
-    * Two connected ways. end node of the first way connects to start node of 
-    * the second way. 
-    *       w2 
+    * Two connected ways. end node of the first way connects to start node of
+    * the second way.
+    *       w2
     *    -------->
-    *    ^ 
+    *    ^
     *    | w1
     *    |
@@ -151,108 +147,108 @@
    @Test
    public void twoConnectedWays_1() {
-	   Node n1 = new Node(1)
-	   n1.setCoor(new LatLon(1,1))
-	   Node n2 = new Node(2)
-	   n2.setCoor(new LatLon(2,1))
-	   Node n3 = new Node(3)
-	   n3.setCoor(new LatLon(2,2))
-	   
-	   Way w1 = new Way(1)
-	   w1.setNodes([n1,n2])
-	   Way w2 = new Way(2)
-	   w2.setNodes([n2,n3])
-
-	   assert builder.phi(w1) == Math.toRadians(90)	   
-	   assert builder.phi(w2) == Math.toRadians(0)
-	   	   
-	   Relation tr = builder.build([w1,w2,n2])
-	   
-	   assert tr != null
-	   assert tr.get("type") == "restriction"
-	   assert tr.getMembersCount() == 3
-	   assert memberWithRole(tr, "from") == w1
-	   assert memberWithRole(tr, "to") == w2
-	   assert memberWithRole(tr, "via") == n2
-	   
-	   assert tr.get("restriction") == "no_right_turn"
-	   	   
-	   /*
-	    * opposite order, from w2 to w1. In this case we have left turn.
-	    */
-	   
-	   tr = builder.build([w2,w1,n2])
-	   
-	   double a = intersectionAngle(w2, w1)
-	   println "a=" + Math.toDegrees(a)
-	   
-	   assert tr != null
-	   assert tr.get("type") == "restriction"
-	   assert tr.getMembersCount() == 3
-	   assert memberWithRole(tr, "from") == w2
-	   assert memberWithRole(tr, "to") == w1
-	   assert memberWithRole(tr, "via") == n2
-	   
-	   assert tr.get("restriction") == "no_left_turn"
-   }
-   
+       Node n1 = new Node(1)
+       n1.setCoor(new LatLon(1,1))
+       Node n2 = new Node(2)
+       n2.setCoor(new LatLon(2,1))
+       Node n3 = new Node(3)
+       n3.setCoor(new LatLon(2,2))
+
+       Way w1 = new Way(1)
+       w1.setNodes([n1,n2])
+       Way w2 = new Way(2)
+       w2.setNodes([n2,n3])
+
+       assert builder.phi(w1) == Math.toRadians(90)
+       assert builder.phi(w2) == Math.toRadians(0)
+
+       Relation tr = builder.build([w1,w2,n2])
+
+       assert tr != null
+       assert tr.get("type") == "restriction"
+       assert tr.getMembersCount() == 3
+       assert memberWithRole(tr, "from") == w1
+       assert memberWithRole(tr, "to") == w2
+       assert memberWithRole(tr, "via") == n2
+
+       assert tr.get("restriction") == "no_right_turn"
+
+       /*
+        * opposite order, from w2 to w1. In this case we have left turn.
+        */
+
+       tr = builder.build([w2,w1,n2])
+
+       double a = intersectionAngle(w2, w1)
+       println "a=" + Math.toDegrees(a)
+
+       assert tr != null
+       assert tr.get("type") == "restriction"
+       assert tr.getMembersCount() == 3
+       assert memberWithRole(tr, "from") == w2
+       assert memberWithRole(tr, "to") == w1
+       assert memberWithRole(tr, "via") == n2
+
+       assert tr.get("restriction") == "no_left_turn"
+   }
+
    /**
-	* Two connected ways. end node of the first way connects to end node of
-	* the second way. left turn.
-	* 
-	*                   w2
-	*           (7,2) -------> (7,5)
-	*                            ^
-	*                            | w1
-	*                            |  
-	*                          (5,5)
-	*/
+    * Two connected ways. end node of the first way connects to end node of
+    * the second way. left turn.
+    *
+    *                   w2
+    *           (7,2) -------> (7,5)
+    *                            ^
+    *                            | w1
+    *                            |
+    *                          (5,5)
+    */
    @Test
    public void twoConnectedWays_2() {
-	   Node n1 = new Node(1)
-	   n1.setCoor(new LatLon(5,5))
-	   Node n2 = new Node(2)
-	   n2.setCoor(new LatLon(7,5))
-	   Node n3 = new Node(3)
-	   n3.setCoor(new LatLon(7,2))
-	   
-	   Way w1 = new Way(1)
-	   w1.setNodes([n1,n2])
-	   Way w2 = new Way(2)
-	   w2.setNodes([n3,n2])
-	   
-	   assert builder.phi(w1) == Math.toRadians(90)
-	   assert builder.phi(w2) == Math.toRadians(0)
-	   assert builder.phi(w2,true) == Math.toRadians(180)
-	   
-	   Relation tr = builder.build([w1,w2,n2])
-	   
-	   assert tr != null
-	   assert tr.get("type") == "restriction"
-	   assert tr.getMembersCount() == 3
-	   assert memberWithRole(tr, "from") == w1
-	   assert memberWithRole(tr, "to") == w2
-	   assert memberWithRole(tr, "via") == n2
-	   
-	   assert tr.get("restriction") == "no_left_turn"
-	   
-	   /*
-	    * opposite order, from w2 to w1. In this case we have right turn.
-	    */
-	   tr = builder.build([w2,w1,n2])
-	   
-	   assert tr != null
-	   assert tr.get("type") == "restriction"
-	   assert tr.getMembersCount() == 3
-	   assert memberWithRole(tr, "from") == w2
-	   assert memberWithRole(tr, "to") == w1
-	   assert memberWithRole(tr, "via") == n2	   
-	   assert tr.get("restriction") == "no_right_turn"
-   }
-   
+       Node n1 = new Node(1)
+       n1.setCoor(new LatLon(5,5))
+       Node n2 = new Node(2)
+       n2.setCoor(new LatLon(7,5))
+       Node n3 = new Node(3)
+       n3.setCoor(new LatLon(7,2))
+
+       Way w1 = new Way(1)
+       w1.setNodes([n1,n2])
+       Way w2 = new Way(2)
+       w2.setNodes([n3,n2])
+
+       assert builder.phi(w1) == Math.toRadians(90)
+       assert builder.phi(w2) == Math.toRadians(0)
+       assert builder.phi(w2,true) == Math.toRadians(180)
+
+       Relation tr = builder.build([w1,w2,n2])
+
+       assert tr != null
+       assert tr.get("type") == "restriction"
+       assert tr.getMembersCount() == 3
+       assert memberWithRole(tr, "from") == w1
+       assert memberWithRole(tr, "to") == w2
+       assert memberWithRole(tr, "via") == n2
+
+       assert tr.get("restriction") == "no_left_turn"
+
+       /*
+        * opposite order, from w2 to w1. In this case we have right turn.
+        */
+       tr = builder.build([w2,w1,n2])
+
+       assert tr != null
+       assert tr.get("type") == "restriction"
+       assert tr.getMembersCount() == 3
+       assert memberWithRole(tr, "from") == w2
+       assert memberWithRole(tr, "to") == w1
+       assert memberWithRole(tr, "via") == n2
+       assert tr.get("restriction") == "no_right_turn"
+   }
+
    /**
    * Two connected ways. end node of the first way connects to end node of
    * the second way. left turn.
    *
-   *                 
+   *
    *           (7,5) -
    *             ^     -    w2
@@ -263,41 +259,41 @@
   @Test
   public void twoConnectedWays_3() {
-	  Node n1 = new Node(1)
-	  n1.setCoor(new LatLon(5,5))
-	  Node n2 = new Node(2)
-	  n2.setCoor(new LatLon(7,5))
-	  Node n3 = new Node(3)
-	  n3.setCoor(new LatLon(6,7))
-	  
-	  Way w1 = new Way(1)
-	  w1.setNodes([n1,n2])
-	  Way w2 = new Way(2)
-	  w2.setNodes([n2,n3])
-	  	  	  
-	  Relation tr = builder.build([w1,w2,n2])
-	  
-	  assert tr != null
-	  assert tr.get("type") == "restriction"
-	  assert tr.getMembersCount() == 3
-	  assert memberWithRole(tr, "from") == w1
-	  assert memberWithRole(tr, "to") == w2
-	  assert memberWithRole(tr, "via") == n2
-	  
-	  assert tr.get("restriction") == "no_right_turn"	 
+      Node n1 = new Node(1)
+      n1.setCoor(new LatLon(5,5))
+      Node n2 = new Node(2)
+      n2.setCoor(new LatLon(7,5))
+      Node n3 = new Node(3)
+      n3.setCoor(new LatLon(6,7))
+
+      Way w1 = new Way(1)
+      w1.setNodes([n1,n2])
+      Way w2 = new Way(2)
+      w2.setNodes([n2,n3])
+
+      Relation tr = builder.build([w1,w2,n2])
+
+      assert tr != null
+      assert tr.get("type") == "restriction"
+      assert tr.getMembersCount() == 3
+      assert memberWithRole(tr, "from") == w1
+      assert memberWithRole(tr, "to") == w2
+      assert memberWithRole(tr, "via") == n2
+
+      assert tr.get("restriction") == "no_right_turn"
   }
-  
-  
+
+
   /**
   * Two connected ways. end node of the first way connects to end node of
   * the second way. left turn.
   *
-  *           
+  *
   *           (10,10)
-  *                 \                   
-  *                  \            
+  *                 \
+  *                  \
   *                   \
-  *                    v           
+  *                    v
   *                     (8,15)
-  *                    /                     
+  *                    /
   *                   /
   *                  /
@@ -307,207 +303,207 @@
  @Test
  public void twoConnectedWays_4() {
-	 Node n1 = new Node(1)
-	 n1.setCoor(new LatLon(10,10))
-	 Node n2 = new Node(2)
-	 n2.setCoor(new LatLon(8,15))
-	 Node n3 = new Node(3)
-	 n3.setCoor(new LatLon(5,11))
-	 
-	 Way w1 = new Way(1)
-	 w1.setNodes([n1,n2])
-	 Way w2 = new Way(2)
-	 w2.setNodes([n2,n3])
-
-	 Relation tr = builder.build([w1,w2,n2])
-	 
-	 assert tr != null
-	 assert tr.get("type") == "restriction"
-	 assert tr.getMembersCount() == 3
-	 assert memberWithRole(tr, "from") == w1
-	 assert memberWithRole(tr, "to") == w2
-	 assert memberWithRole(tr, "via") == n2
-	 
-	 assert tr.get("restriction") == "no_right_turn"
-
-	 
-	 /*
-	  * opposite order, from w2 to w1. In  this case we have left turn.
-	  */
-	 tr = builder.build([w2,w1,n2])
-	 
-	 assert tr != null
-	 assert tr.get("type") == "restriction"
-	 assert tr.getMembersCount() == 3
-	 assert memberWithRole(tr, "from") == w2
-	 assert memberWithRole(tr, "to") == w1
-	 assert memberWithRole(tr, "via") == n2
-	 
-	 assert tr.get("restriction") == "no_left_turn"
-	}
- 
- 
+     Node n1 = new Node(1)
+     n1.setCoor(new LatLon(10,10))
+     Node n2 = new Node(2)
+     n2.setCoor(new LatLon(8,15))
+     Node n3 = new Node(3)
+     n3.setCoor(new LatLon(5,11))
+
+     Way w1 = new Way(1)
+     w1.setNodes([n1,n2])
+     Way w2 = new Way(2)
+     w2.setNodes([n2,n3])
+
+     Relation tr = builder.build([w1,w2,n2])
+
+     assert tr != null
+     assert tr.get("type") == "restriction"
+     assert tr.getMembersCount() == 3
+     assert memberWithRole(tr, "from") == w1
+     assert memberWithRole(tr, "to") == w2
+     assert memberWithRole(tr, "via") == n2
+
+     assert tr.get("restriction") == "no_right_turn"
+
+
+     /*
+      * opposite order, from w2 to w1. In  this case we have left turn.
+      */
+     tr = builder.build([w2,w1,n2])
+
+     assert tr != null
+     assert tr.get("type") == "restriction"
+     assert tr.getMembersCount() == 3
+     assert memberWithRole(tr, "from") == w2
+     assert memberWithRole(tr, "to") == w1
+     assert memberWithRole(tr, "via") == n2
+
+     assert tr.get("restriction") == "no_left_turn"
+    }
+
+
     def Node nn(id, lat, lon) {
-		Node n = new Node(id)
-		n.setCoor(new LatLon(lat, lon))
-		return n
-    }
-	
-	def Way nw(id, Node... nodes) {
-		Way w = new Way(id)
-		w.setNodes(Arrays.asList(nodes))
-		return w
-	}
- 
- 	/** 
- 	 *                              n3
- 	 *                           (10,10)
- 	 *                             ^
- 	 *                             | to
- 	 *      n1      from           |
- 	 *    (5,5) -------------->  (5,10) n2
- 	 */
-	 @Test
-	 public void intersectionAngle_1() {
-		 Node n1 = nn(1,5,5)
-		 Node n2 = nn(2,5,10)
-		 Node n3 = nn(3,10,10)
-		 Way from = nw(1,n1,n2)
-		 Way to = nw(2,n2,n3)
-		 
-		 double a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		 RelativeWayJoinOrientation o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
-		 assert Math.toDegrees(a) == -90
-		 assert o == RelativeWayJoinOrientation.LEFT
-		 
-		 /*
-		  * if reversed from, the intersection angle is still -90�
-		  */
-		 from = nw(1,n2,n1)
-		 to = nw(2,n2,n3)
-		 a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		 o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
-		 assert Math.toDegrees(a) == -90
-		 assert o == RelativeWayJoinOrientation.LEFT
-
-		 /*
-		 * if reversed to, the intersection angle is still -90�
-		 */
-		 from = nw(1,n1,n2)
-		 to = nw(2,n3,n2)
-		 a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		 o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
-		 assert Math.toDegrees(a) == -90
-		 assert o == RelativeWayJoinOrientation.LEFT
-
-		 /*
-		 * if reversed both, the intersection angle is still -90�
-		 */
-		 from = nw(1,n2,n1)
-		 to = nw(2,n3,n2)
-		 a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		 o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
-		 assert Math.toDegrees(a) == -90
-		 assert o == RelativeWayJoinOrientation.LEFT
-	 }
-	 
-	 /**
-	 *      n1      from           
-	 *    (5,5) -------------->  (5,10) n2
-	 *                              |
-	 *                              | to
-	 *                              |
-	 *                              v
-	 *                            (2,10)
-	 *                              n3
-	 *    
-	 */
-	@Test
-	public void intersectionAngle_2() {
-		Node n1 = nn(1,5,5)
-		Node n2 = nn(2,5,10)
-		Node n3 = nn(3,2,10)
-		Way from = nw(1,n1,n2)
-		Way to = nw(2,n2,n3)
-		
-		double a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		assert Math.toDegrees(a) == 90
-		
-		/*
-		 * if reversed from, the intersection angle is still 90�
-		 */
-		from = nw(1,n2,n1)
-		to = nw(2,n2,n3)
-		a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		assert Math.toDegrees(a) == 90
-
-		/*
-		* if reversed to, the intersection angle is still 90�
-		*/
-		from = nw(1,n1,n2)
-		to = nw(2,n3,n2)
-		a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		assert Math.toDegrees(a) == 90
-
-		/*
-		* if reversed both, the intersection angle is still 90�
-		*/
-		from = nw(1,n2,n1)
-		to = nw(2,n3,n2)
-		a = TurnRestrictionBuilder.intersectionAngle(from, to)
-		assert Math.toDegrees(a) == 90
-	}
-	
-	
-	/**
-	 * 
-	 *                       
-	 *             (-1,-6) (n3)
-	 *             ^
-	 *            /
-	 *           /  to
-	 *          /
-	 *      (-5, -10) n2
+        Node n = new Node(id)
+        n.setCoor(new LatLon(lat, lon))
+        return n
+    }
+
+    def Way nw(id, Node... nodes) {
+        Way w = new Way(id)
+        w.setNodes(Arrays.asList(nodes))
+        return w
+    }
+
+     /**
+      *                              n3
+      *                           (10,10)
+      *                             ^
+      *                             | to
+      *      n1      from           |
+      *    (5,5) -------------->  (5,10) n2
+      */
+     @Test
+     public void intersectionAngle_1() {
+         Node n1 = nn(1,5,5)
+         Node n2 = nn(2,5,10)
+         Node n3 = nn(3,10,10)
+         Way from = nw(1,n1,n2)
+         Way to = nw(2,n2,n3)
+
+         double a = TurnRestrictionBuilder.intersectionAngle(from, to)
+         RelativeWayJoinOrientation o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
+         assert Math.toDegrees(a) == -90
+         assert o == RelativeWayJoinOrientation.LEFT
+
+         /*
+          * if reversed from, the intersection angle is still -90�
+          */
+         from = nw(1,n2,n1)
+         to = nw(2,n2,n3)
+         a = TurnRestrictionBuilder.intersectionAngle(from, to)
+         o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
+         assert Math.toDegrees(a) == -90
+         assert o == RelativeWayJoinOrientation.LEFT
+
+         /*
+         * if reversed to, the intersection angle is still -90�
+         */
+         from = nw(1,n1,n2)
+         to = nw(2,n3,n2)
+         a = TurnRestrictionBuilder.intersectionAngle(from, to)
+         o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
+         assert Math.toDegrees(a) == -90
+         assert o == RelativeWayJoinOrientation.LEFT
+
+         /*
+         * if reversed both, the intersection angle is still -90�
+         */
+         from = nw(1,n2,n1)
+         to = nw(2,n3,n2)
+         a = TurnRestrictionBuilder.intersectionAngle(from, to)
+         o = TurnRestrictionBuilder.determineWayJoinOrientation(from,to)
+         assert Math.toDegrees(a) == -90
+         assert o == RelativeWayJoinOrientation.LEFT
+     }
+
+     /**
+     *      n1      from
+     *    (5,5) -------------->  (5,10) n2
+     *                              |
+     *                              | to
+     *                              |
+     *                              v
+     *                            (2,10)
+     *                              n3
+     *
+     */
+    @Test
+    public void intersectionAngle_2() {
+        Node n1 = nn(1,5,5)
+        Node n2 = nn(2,5,10)
+        Node n3 = nn(3,2,10)
+        Way from = nw(1,n1,n2)
+        Way to = nw(2,n2,n3)
+
+        double a = TurnRestrictionBuilder.intersectionAngle(from, to)
+        assert Math.toDegrees(a) == 90
+
+        /*
+         * if reversed from, the intersection angle is still 90�
+         */
+        from = nw(1,n2,n1)
+        to = nw(2,n2,n3)
+        a = TurnRestrictionBuilder.intersectionAngle(from, to)
+        assert Math.toDegrees(a) == 90
+
+        /*
+        * if reversed to, the intersection angle is still 90�
+        */
+        from = nw(1,n1,n2)
+        to = nw(2,n3,n2)
+        a = TurnRestrictionBuilder.intersectionAngle(from, to)
+        assert Math.toDegrees(a) == 90
+
+        /*
+        * if reversed both, the intersection angle is still 90�
+        */
+        from = nw(1,n2,n1)
+        to = nw(2,n3,n2)
+        a = TurnRestrictionBuilder.intersectionAngle(from, to)
+        assert Math.toDegrees(a) == 90
+    }
+
+
+    /**
+     *
+     *
+     *             (-1,-6) (n3)
+     *             ^
+     *            /
+     *           /  to
+     *          /
+     *      (-5, -10) n2
     *           ^
-	*           |
-	*           | from 
-	*           |
-	*       (-10,-10) n1 
-	*/
+    *           |
+    *           | from
+    *           |
+    *       (-10,-10) n1
+    */
    @Test
    public void intersectionAngle_3() {
-	   Node n1 = nn(1,-10,-10)
-	   Node n2 = nn(2,-5,-10)
-	   Node n3 = nn(3,-1,-6)
-	   Way from = nw(1,n1,n2)
-	   Way to = nw(2,n2,n3)
-	   
-	   double a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	   assert Math.toDegrees(a) == 45
-	   
-	   /*
-		* if reversed from, the intersection angle is still 45
-		*/
-	   from = nw(1,n2,n1)
-	   to = nw(2,n2,n3)
-	   a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	   assert Math.toDegrees(a) == 45
-
-	   /*
-	   * if reversed to, the intersection angle is still 45
-	   */
-	   from = nw(1,n1,n2)
-	   to = nw(2,n3,n2)
-	   a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	   assert Math.toDegrees(a) == 45
-
-	   /*
-	   * if reversed both, the intersection angle is still 45
-	   */
-	   from = nw(1,n2,n1)
-	   to = nw(2,n3,n2)
-	   a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	   assert Math.toDegrees(a) == 45
-   }
-   
+       Node n1 = nn(1,-10,-10)
+       Node n2 = nn(2,-5,-10)
+       Node n3 = nn(3,-1,-6)
+       Way from = nw(1,n1,n2)
+       Way to = nw(2,n2,n3)
+
+       double a = TurnRestrictionBuilder.intersectionAngle(from, to)
+       assert Math.toDegrees(a) == 45
+
+       /*
+        * if reversed from, the intersection angle is still 45
+        */
+       from = nw(1,n2,n1)
+       to = nw(2,n2,n3)
+       a = TurnRestrictionBuilder.intersectionAngle(from, to)
+       assert Math.toDegrees(a) == 45
+
+       /*
+       * if reversed to, the intersection angle is still 45
+       */
+       from = nw(1,n1,n2)
+       to = nw(2,n3,n2)
+       a = TurnRestrictionBuilder.intersectionAngle(from, to)
+       assert Math.toDegrees(a) == 45
+
+       /*
+       * if reversed both, the intersection angle is still 45
+       */
+       from = nw(1,n2,n1)
+       to = nw(2,n3,n2)
+       a = TurnRestrictionBuilder.intersectionAngle(from, to)
+       assert Math.toDegrees(a) == 45
+   }
+
    /**
    *
@@ -527,117 +523,117 @@
  @Test
  public void intersectionAngle_4() {
-	 Node n1 = nn(1,-10,-10)
-	 Node n2 = nn(2,-5,-10)
-	 Node n3 = nn(3,-1,-14)
-	 Way from = nw(1,n1,n2)
-	 Way to = nw(2,n2,n3)
-	 
-	 double a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	 assert Math.toDegrees(a) == -45
-	 
-	 /*
-	  * if reversed from, the intersection angle is still -45
-	  */
-	 from = nw(1,n2,n1)
-	 to = nw(2,n2,n3)
-	 a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	 assert Math.toDegrees(a) == -45
-
-	 /*
-	 * if reversed to, the intersection angle is still -45
-	 */
-	 from = nw(1,n1,n2)
-	 to = nw(2,n3,n2)
-	 a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	 assert Math.toDegrees(a) == -45
-
-	 /*
-	 * if reversed both, the intersection angle is still 45
-	 */
-	 from = nw(1,n2,n1)
-	 to = nw(2,n3,n2)
-	 a = TurnRestrictionBuilder.intersectionAngle(from, to)
-	 assert Math.toDegrees(a) == -45
+     Node n1 = nn(1,-10,-10)
+     Node n2 = nn(2,-5,-10)
+     Node n3 = nn(3,-1,-14)
+     Way from = nw(1,n1,n2)
+     Way to = nw(2,n2,n3)
+
+     double a = TurnRestrictionBuilder.intersectionAngle(from, to)
+     assert Math.toDegrees(a) == -45
+
+     /*
+      * if reversed from, the intersection angle is still -45
+      */
+     from = nw(1,n2,n1)
+     to = nw(2,n2,n3)
+     a = TurnRestrictionBuilder.intersectionAngle(from, to)
+     assert Math.toDegrees(a) == -45
+
+     /*
+     * if reversed to, the intersection angle is still -45
+     */
+     from = nw(1,n1,n2)
+     to = nw(2,n3,n2)
+     a = TurnRestrictionBuilder.intersectionAngle(from, to)
+     assert Math.toDegrees(a) == -45
+
+     /*
+     * if reversed both, the intersection angle is still 45
+     */
+     from = nw(1,n2,n1)
+     to = nw(2,n3,n2)
+     a = TurnRestrictionBuilder.intersectionAngle(from, to)
+     assert Math.toDegrees(a) == -45
  }
- 
- 
-	 /*
-	 *
-	 *      n21        w21        n22       w22            n23
-	 *    (10,10)-------------> (10,15) -------------- > (10,20)
-	 *                            ^
-	 *                            |
-	 *                            | w1
-	 *                            |
-	 *                          (5,15)
-	 *                            n11
-	 */
-	@Test
-	public void splitToWay() {
-		Node n11 = new Node(11);
-		n11.setCoor(new LatLon(5,15));
-		
-		Node n21 = new Node(21)
-		n21.setCoor(new LatLon(10,10))
-		Node n22 = new Node(22)
-		n22.setCoor(new LatLon(10,15))
-		Node n23 = new Node(23)
-		n23.setCoor(new LatLon(10,20))
-		
-		Way w1 = new Way(1)
-		w1.setNodes([n11,n22])
-		Way w21 = new Way(21)
-		w21.setNodes([n21,n22])
-		Way w22 = new Way(22)
-		w22.setNodes([n22,n23])
-	
-		Way adjustedTo = selectToWayAfterSplit(
-			w1,
-			w21,
-			w22,
-			TurnRestrictionType.NO_LEFT_TURN
-		)
-		
-		assert adjustedTo != null
-		assert adjustedTo == w21
-		
-		adjustedTo = selectToWayAfterSplit(
-			w1,
-			w21,
-			w22,
-			TurnRestrictionType.NO_RIGHT_TURN
-		)
-		
-		assert adjustedTo != null
-		assert adjustedTo == w22
-		
-		adjustedTo = selectToWayAfterSplit(
-			w1,
-			w21,
-			w22,
-			TurnRestrictionType.ONLY_LEFT_TURN
-		)
-		
-		assert adjustedTo != null
-		assert adjustedTo == w21
-		
-		adjustedTo = selectToWayAfterSplit(
-			w1,
-			w21,
-			w22,
-			TurnRestrictionType.ONLY_RIGHT_TURN
-		)
-		
-		assert adjustedTo != null
-		assert adjustedTo == w22
-		
-		adjustedTo = selectToWayAfterSplit(
-			w1,
-			w21,
-			w22,
-			TurnRestrictionType.NO_STRAIGHT_ON
-		)
-		
-		assert adjustedTo == null
-	}	
+
+
+     /*
+     *
+     *      n21        w21        n22       w22            n23
+     *    (10,10)-------------> (10,15) -------------- > (10,20)
+     *                            ^
+     *                            |
+     *                            | w1
+     *                            |
+     *                          (5,15)
+     *                            n11
+     */
+    @Test
+    public void splitToWay() {
+        Node n11 = new Node(11);
+        n11.setCoor(new LatLon(5,15));
+
+        Node n21 = new Node(21)
+        n21.setCoor(new LatLon(10,10))
+        Node n22 = new Node(22)
+        n22.setCoor(new LatLon(10,15))
+        Node n23 = new Node(23)
+        n23.setCoor(new LatLon(10,20))
+
+        Way w1 = new Way(1)
+        w1.setNodes([n11,n22])
+        Way w21 = new Way(21)
+        w21.setNodes([n21,n22])
+        Way w22 = new Way(22)
+        w22.setNodes([n22,n23])
+
+        Way adjustedTo = selectToWayAfterSplit(
+            w1,
+            w21,
+            w22,
+            TurnRestrictionType.NO_LEFT_TURN
+        )
+
+        assert adjustedTo != null
+        assert adjustedTo == w21
+
+        adjustedTo = selectToWayAfterSplit(
+            w1,
+            w21,
+            w22,
+            TurnRestrictionType.NO_RIGHT_TURN
+        )
+
+        assert adjustedTo != null
+        assert adjustedTo == w22
+
+        adjustedTo = selectToWayAfterSplit(
+            w1,
+            w21,
+            w22,
+            TurnRestrictionType.ONLY_LEFT_TURN
+        )
+
+        assert adjustedTo != null
+        assert adjustedTo == w21
+
+        adjustedTo = selectToWayAfterSplit(
+            w1,
+            w21,
+            w22,
+            TurnRestrictionType.ONLY_RIGHT_TURN
+        )
+
+        assert adjustedTo != null
+        assert adjustedTo == w22
+
+        adjustedTo = selectToWayAfterSplit(
+            w1,
+            w21,
+            w22,
+            TurnRestrictionType.NO_STRAIGHT_ON
+        )
+
+        assert adjustedTo == null
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModelTest.groovy
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModelTest.groovy	(revision 32408)
+++ /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModelTest.groovy	(revision 32409)
@@ -1,70 +1,70 @@
 package org.openstreetmap.josm.plugins.turnrestrictions.editor;
 
-import org.junit.*;
-import static org.junit.Assert.*;
-import org.openstreetmap.josm.plugins.turnrestrictions.editor.ExceptValueModel;
+import static org.junit.Assert.*
+
+import org.junit.*
 
 class ExceptValueModelTest {
 
-	@Test
-	public void constructor() {
-		new ExceptValueModel()
-		
-		def evm = new ExceptValueModel(null)
-		evm = new ExceptValueModel("")	
-		evm = new ExceptValueModel("  ")
-		evm = new ExceptValueModel("hgv")
-		evm = new ExceptValueModel("hgv;psv")
-		evm = new ExceptValueModel("non_standard")
-	}
-	
-	@Test
-	public void setValue() {
-		def evm
-		
-		// null value allowed - means no vehicle exceptions 
-		evm = new ExceptValueModel()
-		evm.setValue(null)
-		assert evm.getValue() == ""
-		assert evm.isStandard()
-		
-		// empty string allowed - means no vehicle expections 
-		evm = new ExceptValueModel()
-		evm.setValue("")
-		assert evm.getValue() == ""
-		assert evm.isStandard()
+    @Test
+    public void constructor() {
+        new ExceptValueModel()
 
-		// a single standard vehicle exeption 
-		evm = new ExceptValueModel()
-		evm.setValue("hgv")
-		assert evm.getValue() == "hgv"
-		assert evm.isVehicleException("hgv")
-		assert ! evm.isVehicleException("psv")
-		assert evm.isStandard()
+        def evm = new ExceptValueModel(null)
+        evm = new ExceptValueModel("")
+        evm = new ExceptValueModel("  ")
+        evm = new ExceptValueModel("hgv")
+        evm = new ExceptValueModel("hgv;psv")
+        evm = new ExceptValueModel("non_standard")
+    }
 
-		// two standard vehicle exceptions 
-		evm = new ExceptValueModel()
-		evm.setValue("hgv;psv")
-		assert evm.getValue() == "hgv;psv"
-		assert evm.isVehicleException("hgv")
-		assert evm.isVehicleException("psv")
-		assert evm.isStandard()
-		
-		// white space and lowercase/uppercase mix allowed. Should be normalized
-		// by the except value model
-		evm = new ExceptValueModel()
-		evm.setValue(" hGv ; PsV  ")
-		assert evm.getValue() == "hgv;psv"
-		assert evm.isVehicleException("hgv")
-		assert evm.isVehicleException("psv")
-		assert evm.isStandard()
-		
-		// non standard value allowed 
-		evm = new ExceptValueModel()
-		evm.setValue("Non Standard")
-		assert evm.getValue() == "Non Standard"
-		assert !evm.isVehicleException("hgv")
-		assert !evm.isVehicleException("psv")
-		assert !evm.isStandard()
-	}	 
+    @Test
+    public void setValue() {
+        def evm
+
+        // null value allowed - means no vehicle exceptions
+        evm = new ExceptValueModel()
+        evm.setValue(null)
+        assert evm.getValue() == ""
+        assert evm.isStandard()
+
+        // empty string allowed - means no vehicle expections
+        evm = new ExceptValueModel()
+        evm.setValue("")
+        assert evm.getValue() == ""
+        assert evm.isStandard()
+
+        // a single standard vehicle exeption
+        evm = new ExceptValueModel()
+        evm.setValue("hgv")
+        assert evm.getValue() == "hgv"
+        assert evm.isVehicleException("hgv")
+        assert ! evm.isVehicleException("psv")
+        assert evm.isStandard()
+
+        // two standard vehicle exceptions
+        evm = new ExceptValueModel()
+        evm.setValue("hgv;psv")
+        assert evm.getValue() == "hgv;psv"
+        assert evm.isVehicleException("hgv")
+        assert evm.isVehicleException("psv")
+        assert evm.isStandard()
+
+        // white space and lowercase/uppercase mix allowed. Should be normalized
+        // by the except value model
+        evm = new ExceptValueModel()
+        evm.setValue(" hGv ; PsV  ")
+        assert evm.getValue() == "hgv;psv"
+        assert evm.isVehicleException("hgv")
+        assert evm.isVehicleException("psv")
+        assert evm.isStandard()
+
+        // non standard value allowed
+        evm = new ExceptValueModel()
+        evm.setValue("Non Standard")
+        assert evm.getValue() == "Non Standard"
+        assert !evm.isVehicleException("hgv")
+        assert !evm.isVehicleException("psv")
+        assert !evm.isStandard()
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModelTest.groovy
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModelTest.groovy	(revision 32408)
+++ /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModelTest.groovy	(revision 32409)
@@ -1,4 +1,5 @@
 package org.openstreetmap.josm.plugins.turnrestrictions.editor;
 
+import static groovy.test.GroovyAssert.shouldFail
 import static org.junit.Assert.*
 
@@ -15,144 +16,142 @@
  * Unit test for {@see JosmSelctionListModel}
  */
-class JosmSelectionListModelTest extends GroovyTestCase {
+class JosmSelectionListModelTest {
 
     @Rule
     public JOSMTestRules rules = new JOSMTestRules().preferences();
 
-    final shouldFail = new GroovyTestCase().&shouldFail
+    @Test
+    public void test_Constructor(){
+        DataSet ds = new DataSet()
+        OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+        JosmSelectionListModel model = new JosmSelectionListModel(layer);
 
-	@Test
-	public void test_Constructor(){
-		DataSet ds = new DataSet()
-		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
-		JosmSelectionListModel model = new JosmSelectionListModel(layer);
+        shouldFail(IllegalArgumentException){
+            model = new JosmSelectionListModel(null)
+        }
+    }
 
-		shouldFail(IllegalArgumentException){
-			model = new JosmSelectionListModel(null)
-		}
-	}
+    @Test
+    public void test_setJOSMSelection() {
+        DataSet ds = new DataSet()
+        OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+        JosmSelectionListModel model = new JosmSelectionListModel(layer);
 
-	@Test
-	public void test_setJOSMSelection() {
-		DataSet ds = new DataSet()
-		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
-		JosmSelectionListModel model = new JosmSelectionListModel(layer);
+        // set a selection with three objects
+        def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
+        model.setJOSMSelection objects
+        assert model.getSize() == 3
 
-		// set a selection with three objects
-		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
-		model.setJOSMSelection objects
-		assert model.getSize() == 3
+        // null is allowed
+        model.setJOSMSelection(null)
+        assert model.getSize() == 0
+        assert model.getSelected().isEmpty()
 
-		// null is allowed
-		model.setJOSMSelection(null)
-		assert model.getSize() == 0
-		assert model.getSelected().isEmpty()
+        // empty has the same effect
+        model.setJOSMSelection([])
+        assert model.getSize() == 0
+        assert model.getSelected().isEmpty()
+    }
 
-		// empty has the same effect
-		model.setJOSMSelection([])
-		assert model.getSize() == 0
-		assert model.getSelected().isEmpty()
-	}
-
-	@Test
-	public void test_setJOSMSelection_withSelected() {
-		DataSet ds = new DataSet()
-		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
-		JosmSelectionListModel model = new JosmSelectionListModel(layer);
-		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
-		model.setJOSMSelection(objects)
-		model.setSelected(objects[0..1])
-		assert model.getSelected().asList() as Set == objects[0..1] as Set
+    @Test
+    public void test_setJOSMSelection_withSelected() {
+        DataSet ds = new DataSet()
+        OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+        JosmSelectionListModel model = new JosmSelectionListModel(layer);
+        def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
+        model.setJOSMSelection(objects)
+        model.setSelected(objects[0..1])
+        assert model.getSelected().asList() as Set == objects[0..1] as Set
 
         // set new selection which includes one object which is currently
         // selected in the model. Should still be selected after setting
         // the new JOSM selection
-		objects = objects[1..2]
-		model.setJOSMSelection(objects)
-		assert model.getSelected().asList() == [objects[0]]
-	}
+        objects = objects[1..2]
+        model.setJOSMSelection(objects)
+        assert model.getSelected().asList() == [objects[0]]
+    }
 
-	@Test
-	public void test_getSelected() {
-		DataSet ds = new DataSet()
-		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+    @Test
+    public void test_getSelected() {
+        DataSet ds = new DataSet()
+        OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
 
-		JosmSelectionListModel model = new JosmSelectionListModel(layer);
-		DefaultListSelectionModel selectionModel = model.getListSelectionModel()
+        JosmSelectionListModel model = new JosmSelectionListModel(layer);
+        DefaultListSelectionModel selectionModel = model.getListSelectionModel()
 
-		assert model.getSelected() != null
-		assert model.getSelected().isEmpty()
+        assert model.getSelected() != null
+        assert model.getSelected().isEmpty()
 
-		// select one element
-		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
-		model.setJOSMSelection(objects)
-		selectionModel.setSelectionInterval(0, 0)
-		assert model.getSelected().asList() == [model.getElementAt(0)];
+        // select one element
+        def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
+        model.setJOSMSelection(objects)
+        selectionModel.setSelectionInterval(0, 0)
+        assert model.getSelected().asList() == [model.getElementAt(0)];
 
-		// select two elements
-		selectionModel.setSelectionInterval(1,2)
-		assert model.getSelected().asList() as Set == [model.getElementAt(1),model.getElementAt(2)] as Set;
-	}
+        // select two elements
+        selectionModel.setSelectionInterval(1,2)
+        assert model.getSelected().asList() as Set == [model.getElementAt(1),model.getElementAt(2)] as Set;
+    }
 
-	@Test
-	public void test_setSelected() {
-		DataSet ds = new DataSet()
-		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+    @Test
+    public void test_setSelected() {
+        DataSet ds = new DataSet()
+        OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
 
-		// set selected with null is OK - nothing selected thereafter
-		JosmSelectionListModel model = new JosmSelectionListModel(layer);
-		DefaultListSelectionModel selectionModel = model.getListSelectionModel()
-		model.setSelected(null)
-		assert model.getSelected().isEmpty()
+        // set selected with null is OK - nothing selected thereafter
+        JosmSelectionListModel model = new JosmSelectionListModel(layer);
+        DefaultListSelectionModel selectionModel = model.getListSelectionModel()
+        model.setSelected(null)
+        assert model.getSelected().isEmpty()
 
-		// set selected with empty list is OK - nothing selected thereafter
-		model.setSelected([])
-		assert model.getSelected().isEmpty()
+        // set selected with empty list is OK - nothing selected thereafter
+        model.setSelected([])
+        assert model.getSelected().isEmpty()
 
-		// select an object existing in the list of displayed objects
-		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
-		model.setJOSMSelection(objects)
-		model.setSelected([objects[0]])
-		assert model.getSelected().asList() == [objects[0]];
+        // select an object existing in the list of displayed objects
+        def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
+        model.setJOSMSelection(objects)
+        model.setSelected([objects[0]])
+        assert model.getSelected().asList() == [objects[0]];
 
-		// select an object not-existing in the list of displayed objects
-		model.setJOSMSelection(objects)
-		model.setSelected([new Way()])
-		assert model.getSelected().isEmpty()
-	}
+        // select an object not-existing in the list of displayed objects
+        model.setJOSMSelection(objects)
+        model.setSelected([new Way()])
+        assert model.getSelected().isEmpty()
+    }
 
-	@Test
-	public void test_editLayerChanged() {
-		DataSet ds = new DataSet()
+    @Test
+    public void test_editLayerChanged() {
+        DataSet ds = new DataSet()
 
-		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
-		objects.each {ds.addPrimitive(it)}
+        def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
+        objects.each {ds.addPrimitive(it)}
 
-		OsmDataLayer layer1 = new OsmDataLayer(ds,"layer1", null)
-		OsmDataLayer layer2 = new OsmDataLayer(new DataSet(),"layer2", null)
+        OsmDataLayer layer1 = new OsmDataLayer(ds,"layer1", null)
+        OsmDataLayer layer2 = new OsmDataLayer(new DataSet(),"layer2", null)
 
         Main.getLayerManager().addLayer(layer1)
         Main.getLayerManager().addLayer(layer2)
 
-		JosmSelectionListModel model = new JosmSelectionListModel(layer1);
-		DefaultListSelectionModel selectionModel = model.getListSelectionModel()
-		// switch from edit layer1 to edit layer2. content of the JOSM selection
-		// should be empty thereafter
+        JosmSelectionListModel model = new JosmSelectionListModel(layer1);
+        DefaultListSelectionModel selectionModel = model.getListSelectionModel()
+        // switch from edit layer1 to edit layer2. content of the JOSM selection
+        // should be empty thereafter
         Main.getLayerManager().setActiveLayer(layer1)
         Main.getLayerManager().setActiveLayer(layer2)
-		assert model.getSize() == 0
+        assert model.getSize() == 0
 
-		// switch from layer2 to layer1 which has one object selected. Object should
-		// be displayed in the JOSM selection list
-		ds.setSelected([objects[0]])
+        // switch from layer2 to layer1 which has one object selected. Object should
+        // be displayed in the JOSM selection list
+        ds.setSelected([objects[0]])
         Main.getLayerManager().setActiveLayer(layer1)
-		assert model.getSize() == 1
-		assert model.getElementAt(0) == objects[0];
+        assert model.getSize() == 1
+        assert model.getElementAt(0) == objects[0];
 
-		// switch to a "null" edit layer (i.e. no edit layer)- nothing should
-		// be displayed in the selection list
+        // switch to a "null" edit layer (i.e. no edit layer)- nothing should
+        // be displayed in the selection list
         Main.getLayerManager().removeLayer(layer2)
         Main.getLayerManager().removeLayer(layer1)
-		assert model.getSize() == 0
-	}
+        assert model.getSize() == 0
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModelUnitTest.groovy
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModelUnitTest.groovy	(revision 32408)
+++ /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModelUnitTest.groovy	(revision 32409)
@@ -1,283 +1,272 @@
 package org.openstreetmap.josm.plugins.turnrestrictions.editor;
-import groovy.util.GroovyTestCase;
-
-import static org.junit.Assert.*;
-import org.junit.*;
+import static groovy.test.GroovyAssert.shouldFail
+import static org.junit.Assert.*
 import static org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionLegRole.*
-import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.data.osm.Relation
-import org.openstreetmap.josm.data.osm.RelationMember
-import org.openstreetmap.josm.data.osm.Node
-import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
-import org.openstreetmap.josm.data.osm.Way
-import org.openstreetmap.josm.data.osm.DataSet
+
+import org.junit.*
 import org.openstreetmap.josm.data.coor.*
-import org.openstreetmap.josm.fixtures.JOSMFixture;
+import org.openstreetmap.josm.data.osm.*
 import org.openstreetmap.josm.gui.layer.OsmDataLayer
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.testutils.JOSMTestRules
 
 /**
  * This is a unit test for {@link TurnRestrictionEditorModel}
- *
  */
-class TurnRestrictionEditorModelUnitTest extends GroovyTestCase{
-
-    final shouldFail = new GroovyTestCase().&shouldFail
+class TurnRestrictionEditorModelUnitTest {
 
     @Rule
     public JOSMTestRules rules = new JOSMTestRules().preferences();
 
-	def navigationControlerMock = [
-       gotoBasicEditor:{}, 
+    def navigationControlerMock = [
+       gotoBasicEditor:{},
        gotoAdvancedEditor: {}
-	] as NavigationControler
-	 
-	private DataSet ds
-	private OsmDataLayer layer
-	private TurnRestrictionEditorModel model 
-	
-	def createNode(id = null, coor = null) {
-	    Node n
-	    if (id == null){
-	    	n = new Node()
-	    } else {
-	    	n = new Node(id)
-	    }
-	    if (coor != null) n.setCoor(coor)
-	    ds.addPrimitive(n)
-	    return n
-	}
-	
-	def createWay(id=null) {
-	    Way w
-	    if (id == null){
-	    	w = new Way()
-	    } else {
-	    	w = new Way(id)
-	    }
-	    ds.addPrimitive(w)
-	    return w
-	}
-	
-	def node(id){
-		return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.NODE))
-	}
-	
-	def way(id) {
-		return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.WAY))
-	}
-	
-	def rel(id){
-		return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.RELATION))
-	}
-	
-	def rm(role,object){
-		return new RelationMember(role, object);
-	}
-	
-	def buildDataSet1() {		
-		// prepare some nodes and ways
-		createNode(21)
-		createNode(22)
-		createNode(31)
-		createNode(32)
-		createWay(2)
-		createWay(3)
-			
-		way(2).setNodes([node(21), node(22)])
-		way(3).setNodes([node(22), node(31)])
-		
-		// a standard turn restriction with a from, a to and a via
-		Relation r = new Relation(1)
-		r.setMembers([rm("from", way(2)), rm("to", way(3)), rm("via", node(22))])
-		r.put "type", "restriction"
-		r.put "restriction", "no_left_turn"		
-		ds.addPrimitive r
-	}
-	
-	@Before
-	public void setUp() {
-		ds = new DataSet()
-		layer = new OsmDataLayer(ds, "test", null)		
-		model = new TurnRestrictionEditorModel(layer, navigationControlerMock);
-	}
-	
-	/**
-	 * Test the constructor 
-	 */
-	@Test
-	public void test_Constructor() {		
-		shouldFail(IllegalArgumentException){
-			model = new TurnRestrictionEditorModel(null, navigationControlerMock);			
-		}
-
-		shouldFail(IllegalArgumentException){
-			model = new TurnRestrictionEditorModel(layer, null);			
-		}
-	}
-	
-	@Test
-	public void test_populate_EmptyTurnRestriction() {		
-		// an "empty" turn restriction with a public id 
-		Relation r = new Relation(1)
-		ds.addPrimitive r
-		assert model.getTurnRestrictionLeg(FROM).isEmpty()
-		assert model.getTurnRestrictionLeg(TO).isEmpty()
-		assert model.getVias().isEmpty()
-		assert model.getRestrictionTagValue() == ""
-	    assert model.getExcept().getValue() == ""
-	}
-	
-	/**
-	 * Populating the model with a simple default turn restriction: one from member (a way),
-	 * one to member (a way), one via (the common node of these ways), minimal tag set with
-	 * type=restriction and restriction=no_left_turn
-	 * 
-	 */
-	@Test
-	public void test_populate_SimpleStandardTurnRestriction() {		
-		buildDataSet1()		
-		model.populate(rel(1))
-		
-		assert model.getTurnRestrictionLeg(FROM).asList() == [way(2)]
-		assert model.getTurnRestrictionLeg(TO).asList() == [way(3)]
-		assert model.getVias() == [node(22)]
-		assert model.getRestrictionTagValue() == "no_left_turn"
-	    assert model.getExcept().getValue() == ""
-	}
-	
-	@Test
-	public void setFrom() {
-		buildDataSet1()		
-		model.populate(rel(1))
-		
-		createNode(41)
-		createNode(42)
-		createWay(4).setNodes([node(41),node(42)]);
-		
-		// set another way as from 
-		model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, way(4).getPrimitiveId())
-		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM).asList() == [way(4)];
-		
-		// delete the/all members with role 'from'
-		model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, null)
-		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM).isEmpty()
-		
-		
-		shouldFail(IllegalArgumentException) {
-			// can't add a node as 'from'
-			model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, node(21).getPrimitiveId())
-		}
-		
-		shouldFail(IllegalStateException) {
-			// can't set a way as 'from' if it isn't part of the dataset 
-			Way way = new Way() 
-			model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, way.getPrimitiveId())
-		}
-	}
-	
-	@Test
-	public void setTo() {
-		buildDataSet1()		
-		model.populate(rel(1))
-		
-		createNode(41)
-		createNode(42)
-		createWay(4).setNodes([node(41),node(42)]);
-		
-		// set another way as from 
-		model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, way(4).getPrimitiveId())
-		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.TO).asList() == [way(4)];
-		
-		// delete the/all members with role 'from'
-		model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, null)
-		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.TO).isEmpty()
-		
-		
-		shouldFail(IllegalArgumentException) {
-			// can't add a node as 'from'
-			model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, node(21).getPrimitiveId())
-		}
-		
-		shouldFail(IllegalStateException) {
-			// can't set a way as 'from' if it isn't part of the dataset 
-			Way way = new Way() 
-			model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, way.getPrimitiveId())
-		}
-	}
-	
-	/**
-	 * Test setting or deleting the tag 'restriction'
-	 */
-	@Test
-	public void setRestrictionTagValue() {
-		buildDataSet1()		
-		model.populate(rel(1))
-		
-		model.setRestrictionTagValue("no_left_turn")
-		assert model.getRestrictionTagValue() == "no_left_turn";
-		
-		model.setRestrictionTagValue(null)
-		assert model.getRestrictionTagValue() == "";
-		
-		model.setRestrictionTagValue("  ")
-		assert model.getRestrictionTagValue() == "";
-		
-		model.setRestrictionTagValue(" no_right_Turn ")
-		assert model.getRestrictionTagValue() == "no_right_turn";		
-	}
-	
-	/**
-	 * Test setting vias
-	 */
-	@Test
-	public void setVias() {
-		buildDataSet1()		
-		model.populate(rel(1))
-		
-		// one node as via - OK
-		model.setVias([node(22)])
-		assert model.getVias() == [node(22)];
-		
-		// pass in null as vias -> remove all vias 
-		model.setVias(null)
-		assert model.getVias().isEmpty()
-		
-		// pass in empty list -> remove all vias 
-		model.setVias([])
-		assert model.getVias().isEmpty()
-		
-		// create a list of vias with a way and twice a node (which doesn't
-		// make sense but is technically allowed)
-		//
-		createNode(41)
-		createNode(42)
-		createWay(4).setNodes([node(41), node(42)])
-		model.setVias([way(4), node(22), node(22)])
-		assert model.getVias() == [way(4), node(22), node(22)];
-
-        // null values in the list of vias are skipped 		                     
+    ] as NavigationControler
+
+    private DataSet ds
+    private OsmDataLayer layer
+    private TurnRestrictionEditorModel model
+
+    def createNode(id = null, coor = null) {
+        Node n
+        if (id == null){
+            n = new Node()
+        } else {
+            n = new Node(id)
+        }
+        if (coor != null) n.setCoor(coor)
+        ds.addPrimitive(n)
+        return n
+    }
+
+    def createWay(id=null) {
+        Way w
+        if (id == null){
+            w = new Way()
+        } else {
+            w = new Way(id)
+        }
+        ds.addPrimitive(w)
+        return w
+    }
+
+    def node(id){
+        return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.NODE))
+    }
+
+    def way(id) {
+        return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.WAY))
+    }
+
+    def rel(id){
+        return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.RELATION))
+    }
+
+    def rm(role,object){
+        return new RelationMember(role, object);
+    }
+
+    def buildDataSet1() {
+        // prepare some nodes and ways
+        createNode(21)
+        createNode(22)
+        createNode(31)
+        createNode(32)
+        createWay(2)
+        createWay(3)
+
+        way(2).setNodes([node(21), node(22)])
+        way(3).setNodes([node(22), node(31)])
+
+        // a standard turn restriction with a from, a to and a via
+        Relation r = new Relation(1)
+        r.setMembers([rm("from", way(2)), rm("to", way(3)), rm("via", node(22))])
+        r.put "type", "restriction"
+        r.put "restriction", "no_left_turn"
+        ds.addPrimitive r
+    }
+
+    @Before
+    public void setUp() {
+        ds = new DataSet()
+        layer = new OsmDataLayer(ds, "test", null)
+        model = new TurnRestrictionEditorModel(layer, navigationControlerMock);
+    }
+
+    /**
+     * Test the constructor
+     */
+    @Test
+    public void test_Constructor() {
+        shouldFail(IllegalArgumentException){
+            model = new TurnRestrictionEditorModel(null, navigationControlerMock);
+        }
+
+        shouldFail(IllegalArgumentException){
+            model = new TurnRestrictionEditorModel(layer, null);
+        }
+    }
+
+    @Test
+    public void test_populate_EmptyTurnRestriction() {
+        // an "empty" turn restriction with a public id
+        Relation r = new Relation(1)
+        ds.addPrimitive r
+        assert model.getTurnRestrictionLeg(FROM).isEmpty()
+        assert model.getTurnRestrictionLeg(TO).isEmpty()
+        assert model.getVias().isEmpty()
+        assert model.getRestrictionTagValue() == ""
+        assert model.getExcept().getValue() == ""
+    }
+
+    /**
+     * Populating the model with a simple default turn restriction: one from member (a way),
+     * one to member (a way), one via (the common node of these ways), minimal tag set with
+     * type=restriction and restriction=no_left_turn
+     *
+     */
+    @Test
+    public void test_populate_SimpleStandardTurnRestriction() {
+        buildDataSet1()
+        model.populate(rel(1))
+
+        assert model.getTurnRestrictionLeg(FROM).asList() == [way(2)]
+        assert model.getTurnRestrictionLeg(TO).asList() == [way(3)]
+        assert model.getVias() == [node(22)]
+        assert model.getRestrictionTagValue() == "no_left_turn"
+        assert model.getExcept().getValue() == ""
+    }
+
+    @Test
+    public void setFrom() {
+        buildDataSet1()
+        model.populate(rel(1))
+
+        createNode(41)
+        createNode(42)
+        createWay(4).setNodes([node(41),node(42)]);
+
+        // set another way as from
+        model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, way(4).getPrimitiveId())
+        assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM).asList() == [way(4)];
+
+        // delete the/all members with role 'from'
+        model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, null)
+        assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM).isEmpty()
+
+
+        shouldFail(IllegalArgumentException) {
+            // can't add a node as 'from'
+            model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, node(21).getPrimitiveId())
+        }
+
+        shouldFail(IllegalStateException) {
+            // can't set a way as 'from' if it isn't part of the dataset
+            Way way = new Way()
+            model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, way.getPrimitiveId())
+        }
+    }
+
+    @Test
+    public void setTo() {
+        buildDataSet1()
+        model.populate(rel(1))
+
+        createNode(41)
+        createNode(42)
+        createWay(4).setNodes([node(41),node(42)]);
+
+        // set another way as from
+        model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, way(4).getPrimitiveId())
+        assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.TO).asList() == [way(4)];
+
+        // delete the/all members with role 'from'
+        model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, null)
+        assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.TO).isEmpty()
+
+
+        shouldFail(IllegalArgumentException) {
+            // can't add a node as 'from'
+            model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, node(21).getPrimitiveId())
+        }
+
+        shouldFail(IllegalStateException) {
+            // can't set a way as 'from' if it isn't part of the dataset
+            Way way = new Way()
+            model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, way.getPrimitiveId())
+        }
+    }
+
+    /**
+     * Test setting or deleting the tag 'restriction'
+     */
+    @Test
+    public void setRestrictionTagValue() {
+        buildDataSet1()
+        model.populate(rel(1))
+
+        model.setRestrictionTagValue("no_left_turn")
+        assert model.getRestrictionTagValue() == "no_left_turn";
+
+        model.setRestrictionTagValue(null)
+        assert model.getRestrictionTagValue() == "";
+
+        model.setRestrictionTagValue("  ")
+        assert model.getRestrictionTagValue() == "";
+
+        model.setRestrictionTagValue(" no_right_Turn ")
+        assert model.getRestrictionTagValue() == "no_right_turn";
+    }
+
+    /**
+     * Test setting vias
+     */
+    @Test
+    public void setVias() {
+        buildDataSet1()
+        model.populate(rel(1))
+
+        // one node as via - OK
+        model.setVias([node(22)])
+        assert model.getVias() == [node(22)];
+
+        // pass in null as vias -> remove all vias
+        model.setVias(null)
+        assert model.getVias().isEmpty()
+
+        // pass in empty list -> remove all vias
+        model.setVias([])
+        assert model.getVias().isEmpty()
+
+        // create a list of vias with a way and twice a node (which doesn't
+        // make sense but is technically allowed)
+        //
+        createNode(41)
+        createNode(42)
+        createWay(4).setNodes([node(41), node(42)])
+        model.setVias([way(4), node(22), node(22)])
+        assert model.getVias() == [way(4), node(22), node(22)];
+
+        // null values in the list of vias are skipped
         model.setVias([null, node(22)])
         assert model.getVias() == [node(22)]
-                                   
+
         shouldFail(IllegalArgumentException) {
-			// an object which doesn't belong to the same dataset can't
-			// be a via
-			Node n = new Node(new LatLon(0,0))
-			model.setVias([n])
-		}
-	}
-	
-	/**
-	 * Tests whether the three sub models exist
-	 */
-	@Test
-	public void submodelsExist() {
-		assert model.getIssuesModel() != null
-		assert model.getRelationMemberEditorModel() != null
-		assert model.getTagEditorModel() != null
-		
-		assert model.getLayer() == layer 
-	}	
+            // an object which doesn't belong to the same dataset can't
+            // be a via
+            Node n = new Node(new LatLon(0,0))
+            model.setVias([n])
+        }
+    }
+
+    /**
+     * Tests whether the three sub models exist
+     */
+    @Test
+    public void submodelsExist() {
+        assert model.getIssuesModel() != null
+        assert model.getRelationMemberEditorModel() != null
+        assert model.getTagEditorModel() != null
+
+        assert model.getLayer() == layer
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorUnitTest.groovy
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorUnitTest.groovy	(revision 32408)
+++ /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorUnitTest.groovy	(revision 32409)
@@ -1,54 +1,51 @@
 package org.openstreetmap.josm.plugins.turnrestrictions.editor;
 
-import groovy.util.GroovyTestCase;
+import static groovy.test.GroovyAssert.shouldFail
+import static org.junit.Assert.*
 
-import org.openstreetmap.josm.data.osm.DataSet;
+import org.junit.*
+import org.openstreetmap.josm.data.osm.DataSet
 import org.openstreetmap.josm.gui.layer.OsmDataLayer
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.testutils.JOSMTestRules
 
-import static org.junit.Assert.*;
-import org.junit.*;
 /**
  * Unit test for the {@link TurnRestrictionLegEditor}
- * 
  */
-class TurnRestrictionLegEditorUnitTest extends GroovyTestCase {
-    final shouldFail = new GroovyTestCase().&shouldFail
+class TurnRestrictionLegEditorUnitTest  {
 
     @Rule
     public JOSMTestRules rules = new JOSMTestRules().preferences();
 
-	def navigationControlerMock = [
-       gotoBasicEditor:{}, 
+    def navigationControlerMock = [
+       gotoBasicEditor:{},
        gotoAdvancedEditor: {}
-	] as NavigationControler
-	
-	private DataSet ds
-	private OsmDataLayer layer
-	private TurnRestrictionEditorModel model 
-	
-	@Before
-	public void setUp() {
-		ds = new DataSet()
-		layer = new OsmDataLayer(ds, "test", null)		
-		model = new TurnRestrictionEditorModel(layer, navigationControlerMock);
-	}
-	 
-	@Test
-	public void test_Constructor() {
-		
-		TurnRestrictionLegEditor editor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM)
-		
-		assert editor.getModel() == model
-		assert editor.getRole() == TurnRestrictionLegRole.FROM
-		
-		shouldFail(IllegalArgumentException) {
-			editor = new TurnRestrictionLegEditor(null, TurnRestrictionLegRole.FROM)
-		}
+    ] as NavigationControler
 
-		shouldFail(IllegalArgumentException) {
-			editor = new TurnRestrictionLegEditor(model, null)
-		}
-	}
+    private DataSet ds
+    private OsmDataLayer layer
+    private TurnRestrictionEditorModel model
+
+    @Before
+    public void setUp() {
+        ds = new DataSet()
+        layer = new OsmDataLayer(ds, "test", null)
+        model = new TurnRestrictionEditorModel(layer, navigationControlerMock);
+    }
+
+    @Test
+    public void test_Constructor() {
+
+        TurnRestrictionLegEditor editor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM)
+
+        assert editor.getModel() == model
+        assert editor.getRole() == TurnRestrictionLegRole.FROM
+
+        shouldFail(IllegalArgumentException) {
+            editor = new TurnRestrictionLegEditor(null, TurnRestrictionLegRole.FROM)
+        }
+
+        shouldFail(IllegalArgumentException) {
+            editor = new TurnRestrictionLegEditor(model, null)
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRendererTest.groovy
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRendererTest.groovy	(revision 32408)
+++ /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRendererTest.groovy	(revision 32409)
@@ -1,41 +1,37 @@
 package org.openstreetmap.josm.plugins.turnrestrictions.editor;
 
-import static org.junit.Assert.*;
-import org.junit.*;
+import static org.junit.Assert.*
 
-import groovy.util.GroovyTestCase;
+import org.junit.*
+import org.openstreetmap.josm.testutils.JOSMTestRules
 
-import java.awt.Component
-import org.openstreetmap.josm.JOSMFixture
-import org.openstreetmap.josm.testutils.JOSMTestRules;;
-
-class TurnRestrictionTypeRendererTest extends GroovyTestCase{
+class TurnRestrictionTypeRendererTest {
 
     @Rule
     public JOSMTestRules rules = new JOSMTestRules().preferences();
 
-	@Test
-	public void test_Constructor() {
-		TurnRestrictionTypeRenderer renderer = new TurnRestrictionTypeRenderer();
-		
-		assert renderer.@icons != null
-		assert renderer.@icons.get(TurnRestrictionType.NO_LEFT_TURN) != null
-	}
-	
-	@Test
-	public void test_getListCellRendererComponent_1() {
-		TurnRestrictionTypeRenderer renderer = new TurnRestrictionTypeRenderer();
-		
-		def c = renderer.getListCellRendererComponent(null, null, 0, false, false)		
-		assert c.getIcon() == null
-		assert c.getText() != null
-		
-		c = renderer.getListCellRendererComponent(null, "non-standard-value", 0, false, false)		
-		assert c.getIcon() == null
-		assert c.getText() == "non-standard-value"	
+    @Test
+    public void test_Constructor() {
+        TurnRestrictionTypeRenderer renderer = new TurnRestrictionTypeRenderer();
 
-		c = renderer.getListCellRendererComponent(null, TurnRestrictionType.NO_LEFT_TURN, 0, false, false)		
-		assert c.getIcon() == renderer.@icons.get(TurnRestrictionType.NO_LEFT_TURN)
-		assert c.getText() == TurnRestrictionType.NO_LEFT_TURN.getDisplayName()
-	}
+        assert renderer.@icons != null
+        assert renderer.@icons.get(TurnRestrictionType.NO_LEFT_TURN) != null
+    }
+
+    @Test
+    public void test_getListCellRendererComponent_1() {
+        TurnRestrictionTypeRenderer renderer = new TurnRestrictionTypeRenderer();
+
+        def c = renderer.getListCellRendererComponent(null, null, 0, false, false)
+        assert c.getIcon() == null
+        assert c.getText() != null
+
+        c = renderer.getListCellRendererComponent(null, "non-standard-value", 0, false, false)
+        assert c.getIcon() == null
+        assert c.getText() == "non-standard-value"
+
+        c = renderer.getListCellRendererComponent(null, TurnRestrictionType.NO_LEFT_TURN, 0, false, false)
+        assert c.getIcon() == renderer.@icons.get(TurnRestrictionType.NO_LEFT_TURN)
+        assert c.getText() == TurnRestrictionType.NO_LEFT_TURN.getDisplayName()
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeTest.groovy
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeTest.groovy	(revision 32408)
+++ /applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeTest.groovy	(revision 32409)
@@ -1,20 +1,20 @@
 package org.openstreetmap.josm.plugins.turnrestrictions.editor;
-import groovy.util.GroovyTestCase;
+import static org.junit.Assert.*
 
-import static org.junit.Assert.*;
 import org.junit.*
-class TurnRestrictionTypeTest extends GroovyTestCase{
-	
-	@Test
-	public void test_fromTagValue() {
-		
-		TurnRestrictionType type = TurnRestrictionType.fromTagValue("no_left_turn")
-		assert type == TurnRestrictionType.NO_LEFT_TURN
-		
-		type = TurnRestrictionType.fromTagValue("doesnt_exist")
-		assert type == null
-		
-		type = TurnRestrictionType.fromTagValue(null)
-		assert type == null
-	}
+
+class TurnRestrictionTypeTest {
+
+    @Test
+    public void test_fromTagValue() {
+
+        TurnRestrictionType type = TurnRestrictionType.fromTagValue("no_left_turn")
+        assert type == TurnRestrictionType.NO_LEFT_TURN
+
+        type = TurnRestrictionType.fromTagValue("doesnt_exist")
+        assert type == null
+
+        type = TurnRestrictionType.fromTagValue(null)
+        assert type == null
+    }
 }
