Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java	(revision 32296)
@@ -0,0 +1,93 @@
+package org.openstreetmap.josm.plugins.pt_assistant.data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils;
+
+/**
+ * Creates a representation of a route relation in the pt_assistant data model,
+ * then maintains a list of PTStops and PTWays of a route.
+ * 
+ * @author darya
+ *
+ */
+public class PTRouteDataManager {
+
+	/* The route relation */
+	Relation relation;
+
+	/* Stores all relation members that are PTStops */
+	private List<PTStop> ptstops = new ArrayList<>();
+
+	/* Stores all relation members that are PTWays */
+	private List<PTWay> ptways = new ArrayList<>();
+
+	public PTRouteDataManager(Relation relation) {
+
+		// It is assumed that the relation is a route. Build in a check here
+		// (e.g. from class RouteUtils) if you want to invoke this constructor
+		// from outside the pt_assitant SegmentChecker)
+		
+		this.relation = relation;
+		
+		PTStop prev = null; // stores the last created PTStop
+
+		for (RelationMember member : this.relation.getMembers()) {
+
+			if (RouteUtils.isPTStop(member)) {
+				// check if there are consecutive elements that belong to the
+				// same stop:
+				if (prev != null && prev.getName().equalsIgnoreCase(member.getMember().get("name"))) {
+					// this PTStop already exists, so just add a new element:
+					prev.addStopElement(member);
+					// TODO: something may need to be done if adding the element
+					// did not succeed. The failure is a result of the same stop
+					// having >1 stop_position, platform or stop_area.
+				} else {
+					// this PTStop does not exist yet, so create it:
+					PTStop ptstop = new PTStop(member);
+					ptstops.add(ptstop);
+					prev = ptstop;
+				}
+
+			} else {
+				PTWay ptway = new PTWay(member);
+				ptways.add(ptway);
+			}
+		}
+	}
+	
+	public List<PTStop> getPTStops() {
+		return this.ptstops;
+	}
+	
+	public List<PTWay> getPTWays() {
+		return this.ptways;
+	}
+	
+	public int getPTStopCount() {
+		return ptstops.size();
+	}
+	
+	public int getPTWayCount() {
+		return this.ptways.size();
+	}
+	
+	public PTStop getFirstStop() {
+		if (this.ptstops.isEmpty()) {
+			return null;
+		}
+		return this.ptstops.get(0);
+	}
+	
+	public PTStop getLastStop() {
+		if (this.ptstops.isEmpty()) {
+			return null;
+		}
+		return this.ptstops.get(ptstops.size()-1);
+	}
+
+}
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteSegment.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteSegment.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteSegment.java	(revision 32296)
@@ -0,0 +1,45 @@
+package org.openstreetmap.josm.plugins.pt_assistant.data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a piece of a route that includes two consecutive stops and the
+ * ways between them. Route segments are ordered, i.e. for most routes there
+ * will be two route segments between each pair of consecutive stops, one in
+ * each direction.
+ * 
+ * @author darya
+ *
+ */
+
+public class PTRouteSegment {
+
+	private PTStop firstStop;
+	private PTStop lastStop;
+	private List<PTWay> ptways;
+	
+	public PTRouteSegment(PTStop firstStop, PTStop lastStop, List<PTWay> ways) {
+		this.firstStop = firstStop;
+		this.lastStop = lastStop;
+		this.ptways = new ArrayList<>(ways.size());
+		ptways.addAll(ways);
+	}
+	
+	public List<PTWay> getPTWays() {
+		return this.ptways;
+	}
+	
+	public PTStop getFirstStop() {
+		return this.firstStop;
+	}
+	
+	public PTStop getLastStop() {
+		return this.lastStop;
+	}
+	
+	
+	
+	
+
+}
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java	(revision 32296)
@@ -0,0 +1,100 @@
+package org.openstreetmap.josm.plugins.pt_assistant.data;
+
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
+
+public class PTStop extends RelationMember {
+
+	private Node stopPosition = null;
+	private OsmPrimitive platform = null;
+	private Relation stopArea = null;
+	
+	/* Name of this stop */
+	private String name = "";
+
+	public PTStop(RelationMember other) throws IllegalArgumentException {
+
+		super(other);
+
+		if (other.getRole().equals("stop_position") && other.getType().equals(OsmPrimitiveType.NODE)) {
+			this.stopPosition = other.getNode();
+		} else if (other.getRole().equals("platform") || other.getRole().equals("platform_entry_only")
+				|| other.getRole().equals("platform_exit_only")) {
+			this.platform = other.getMember();
+		} else if (other.getRole().equals("stop_area") && other.getType().equals(OsmPrimitiveType.RELATION)) {
+			this.stopArea = other.getRelation();
+		} else {
+			throw new IllegalArgumentException("The RelationMember type does not match its role");
+		}
+		
+		this.name = other.getMember().get("name");
+
+	}
+
+	/**
+	 * Adds the given element to the stop after a check
+	 * 
+	 * @param member
+	 *            Element to add
+	 * @return true if added successfully, false otherwise. A false value
+	 *         indicates either that the OsmPrimitiveType of the given
+	 *         RelationMember does not match its role or that this PTStop
+	 *         already has an attribute with that role.
+	 */
+	public boolean addStopElement(RelationMember member) {
+
+		// each element is only allowed once per stop
+
+		// add stop position:
+		if (member.getRole().equals("stop_position")) {
+			if (member.getType().equals(OsmPrimitiveType.NODE) && stopPosition == null) {
+				this.stopPosition = member.getNode();
+				return true;
+			}
+		}
+
+		// add platform:
+		if (member.getRole().equals("platform") || member.getRole().equals("platform_entry_only")
+				|| member.getRole().equals("platform_exit_only")) {
+			if (platform == null) {
+				platform = member.getMember();
+				return true;
+			}
+		}
+
+		// add stop_area:
+		if (member.getRole().equals("stop_area") && member.getType().equals(OsmPrimitiveType.RELATION)) {
+			if (stopArea == null) {
+				stopArea = member.getRelation();
+				return true;
+			}
+		}
+
+		return false;
+
+	}
+	
+	public Node getStopPosition() {
+		return this.stopPosition;
+	}
+	
+	/**
+	 * Returns platform (including platform_entry_only and platform_exit_only)
+	 * @return
+	 */
+	public OsmPrimitive getPlatform() {
+		return this.platform;
+	}
+	
+	public Relation getStopArea() {
+		return this.stopArea;
+	}
+	
+	public String getName() {
+		return this.name;
+	}
+
+}
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTWay.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTWay.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTWay.java	(revision 32296)
@@ -0,0 +1,66 @@
+package org.openstreetmap.josm.plugins.pt_assistant.data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
+import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.data.osm.Way;
+
+/**
+ * Representation of PTWays, which can be of OsmPrimitiveType Way or Relation
+ * 
+ * @author darya
+ *
+ */
+public class PTWay extends RelationMember {
+
+	/*
+	 * Ways that belong to this PTWay. If the corresponding relation member is
+	 * OsmPrimitiveType.WAY, this list size is 1. If the corresponding relation
+	 * member is a nested relation, the list size is >= 1.
+	 */
+	private List<Way> ways = new ArrayList<Way>();
+
+	/**
+	 * 
+	 * @param other
+	 *            the corresponding RelationMember
+	 * @throws IllegalArgumentException
+	 *             if the given relation member cannot be a PTWay due to its
+	 *             OsmPrimitiveType and/or role.
+	 */
+	public PTWay(RelationMember other) throws IllegalArgumentException {
+
+		super(other);
+
+		if (other.getType().equals(OsmPrimitiveType.WAY)) {
+			ways.add(other.getWay());
+		} else if (other.getType().equals(OsmPrimitiveType.RELATION)) {
+			for (RelationMember rm : other.getRelation().getMembers()) {
+				if (rm.getType().equals(OsmPrimitiveType.WAY)) {
+					ways.add(rm.getWay());
+				} else {
+					throw new IllegalArgumentException(
+							"A route relation member of OsmPrimitiveType.RELATION can only have ways as members");
+				}
+			}
+		} else {
+			// the RelationMember other cannot be a OsmPrimitiveType.NODE
+			throw new IllegalArgumentException("A node cannot be used to model a public transport way");
+		}
+
+	}
+
+	/**
+	 * Returns the course of this PTWay. In most cases, this list only has 1
+	 * element. In the case of nested relations in a route, the list can have
+	 * multiple elements.
+	 * 
+	 * @return
+	 */
+	public List<Way> getWays() {
+		return this.ways;
+	}
+
+}
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java	(revision 32296)
@@ -66,4 +66,6 @@
 		if (rm.getType().equals(OsmPrimitiveType.RELATION)) {
 			if (rm.getRole().equals("stop_area")) {
+				return true;
+			} else if (rm.getRole().equals("platform") || rm.getRole().equals("platform_entry_only") || rm.getRole().equals("platform_exit_only")){
 				return true;
 			} else {
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java	(revision 32296)
@@ -11,4 +11,12 @@
 import org.openstreetmap.josm.data.osm.Way;
 
+/**
+ * Assigns stops to ways in following steps: (1) checks if the stop is in the
+ * list of already assigned stops, (2) checks if the stop has a stop position,
+ * (3) calculates it using proximity / growing bounding boxes
+ * 
+ * @author darya
+ *
+ */
 public final class StopToWayAssigner {
 
@@ -23,14 +31,11 @@
 			return stopToWay.get(stop.getId());
 		}
-		
 
-		
-		
 		if (stop.getType().equals(OsmPrimitiveType.NODE)) {
 			List<OsmPrimitive> referrers = stop.getReferrers();
 			List<Way> referredWays = new ArrayList<>();
-			for (OsmPrimitive referrer: referrers) {
+			for (OsmPrimitive referrer : referrers) {
 				if (referrer.getType().equals(OsmPrimitiveType.WAY)) {
-					referredWays.add((Way)referrer);
+					referredWays.add((Way) referrer);
 				}
 			}
@@ -45,7 +50,8 @@
 		return null;
 	}
-	
+
 	/**
 	 * Remove a map entry
+	 * 
 	 * @param stopId
 	 */
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/Checker.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/Checker.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/Checker.java	(revision 32296)
@@ -0,0 +1,46 @@
+package org.openstreetmap.josm.plugins.pt_assistant.validation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.validation.Test;
+import org.openstreetmap.josm.data.validation.TestError;
+
+
+/**
+ * Represents tests and fixed of the PT_Assistant plugin 
+ * 
+ * @author darya
+ *
+ */
+public abstract class Checker {
+	
+	// test which created this WayChecker:
+	protected final Test test;
+
+	// relation that is checked:
+	protected Relation relation;
+
+	// stores all found errors:
+	protected ArrayList<TestError> errors = new ArrayList<>();
+	
+	protected Checker(Relation relation, Test test) {
+		
+		this.relation = relation;
+		this.test = test;
+
+	}
+	
+	/**
+	 * Returns errors
+	 */
+	public List<TestError> getErrors() {
+
+		return errors;
+	}
+	
+	
+	
+
+}
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RouteChecker.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RouteChecker.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RouteChecker.java	(revision 32296)
@@ -19,24 +19,20 @@
 import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils;
 
-public class RouteChecker {
+/**
+ * Performs tests of a route at the level of the whole route: sorting test
+ * 
+ * @author darya
+ *
+ */
+public class RouteChecker extends Checker {
 
-	// test which created this WayChecker:
-	private final Test test;
-
-	// relation that is checked:
-	private Relation relation;
-
-	// stores all found errors (on way level):
-	private ArrayList<TestError> errors = new ArrayList<>();
-	
 	private boolean hasGap;
 
 	List<RelationMember> sortedMembers;
 
-	public RouteChecker(Relation r, Test t) {
+	public RouteChecker(Relation relation, Test test) {
 
-		this.test = t;
-		this.relation = r;
-		
+		super(relation, test);
+
 		this.hasGap = false;
 
@@ -60,7 +56,7 @@
 
 		if (hasGap(waysToCheck)) {
-			
+
 			this.hasGap = true;
-			
+
 			RelationSorter sorter = new RelationSorter();
 			sortedMembers = sorter.sortMembers(waysToCheck);
@@ -103,12 +99,4 @@
 	}
 
-	/**
-	 * Returns errors
-	 */
-	public List<TestError> getErrors() {
-
-		return errors;
-	}
-
 	public List<RelationMember> getSortedMembers() {
 
@@ -116,9 +104,9 @@
 
 	}
-	
+
 	public boolean getHasGap() {
-		
+
 		return this.hasGap;
-		
+
 	}
 
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java	(revision 32296)
@@ -0,0 +1,57 @@
+package org.openstreetmap.josm.plugins.pt_assistant.validation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.data.validation.Test;
+import org.openstreetmap.josm.plugins.pt_assistant.data.PTRouteDataManager;
+import org.openstreetmap.josm.plugins.pt_assistant.data.PTRouteSegment;
+import org.openstreetmap.josm.plugins.pt_assistant.data.PTStop;
+import org.openstreetmap.josm.plugins.pt_assistant.data.PTWay;
+import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils;
+
+/**
+ * Performs tests of a route at the level of route segments (the stop-by-stop
+ * approach).
+ * 
+ * @author darya
+ *
+ */
+public class SegmentChecker extends Checker {
+
+	/*
+	 * PTRouteSegments that have been validated and are correct. They need to
+	 * accessible
+	 */
+	private static List<PTRouteSegment> correctSegments = new ArrayList<PTRouteSegment>();
+
+	private PTRouteDataManager manager;
+
+	public SegmentChecker(Relation relation, Test test) {
+
+		super(relation, test);
+		
+		this.manager = new PTRouteDataManager(relation);
+
+	}
+
+	private void performEndstopTest() {
+		
+		if (manager.getPTStopCount() < 2) {
+			// it does not make sense to check a route that has less than 2 stops
+			return;
+		}
+		
+		PTStop firstStop = manager.getFirstStop();
+		PTStop lastStop = manager.getLastStop();
+		
+		// TODO: we need the stops to be assigned to routes.
+	}
+
+	private void performSegmentTest() {
+		// TODO
+	}
+
+}
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java	(revision 32296)
@@ -19,27 +19,14 @@
 
 /**
- * Performs the DirectionTest and RoadTypeTest at the level of single ways
+ * Performs tests of a route at the level of single ways: DirectionTest and RoadTypeTest
  * 
  * @author darya
  *
  */
-public class WayChecker {
+public class WayChecker extends Checker {
 
-	// test which created this WayChecker:
-	private final Test test;
+	public WayChecker(Relation relation, Test test) {
 
-	// relation that is checked:
-	private Relation relation;
-
-	// stores all found errors (on way level):
-	private ArrayList<TestError> errors = new ArrayList<>();
-
-	// stores all ways that were found wrong and need to be removed:
-	private ArrayList<Way> wrongWays = new ArrayList<>();
-
-	public WayChecker(Relation r, Test test) {
-
-		this.test = test;
-		this.relation = r;
+		super(relation, test);
 
 		this.performDirectionTest();
@@ -160,9 +147,4 @@
 	}
 
-	public List<TestError> getErrors() {
-
-		return errors;
-	}
-
 	/**
 	 * Checks if the type of the way is suitable for buses to go on it. The
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java	(revision 32296)
@@ -1,3 +1,3 @@
-package org.openstreetmap.josm.plugins.pt_assistant;
+package unit.org.openstreetmap.josm.plugins.pt_assistant;
 
 import org.junit.BeforeClass;
@@ -36,4 +36,7 @@
  public static final String PATH_TO_PLATFORM_AS_WAY = "test/data/route-with-platform-as-way.osm";
  
+ public static final String PATH_TO_ROUNDABOUT_ONEWAY = "test/data/duesseldorf_roundabout.osm";
+ 
+ public static final String PATH_TO_ROAD_TYPE_ERROR = "test/data/road-type.osm";
  
  
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/ImportUtils.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/ImportUtils.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/ImportUtils.java	(revision 32296)
@@ -1,3 +1,3 @@
-package org.openstreetmap.josm.plugins.pt_assistant;
+package unit.org.openstreetmap.josm.plugins.pt_assistant;
 
 /**
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/TestUtil.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/TestUtil.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/TestUtil.java	(revision 32296)
@@ -1,3 +1,3 @@
-package org.openstreetmap.josm.plugins.pt_assistant;
+package unit.org.openstreetmap.josm.plugins.pt_assistant;
 
 import static org.junit.Assert.assertEquals;
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteRepresentationTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteRepresentationTest.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteRepresentationTest.java	(revision 32296)
@@ -0,0 +1,248 @@
+package unit.org.openstreetmap.josm.plugins.pt_assistant.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+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.pt_assistant.data.PTRouteDataManager;
+
+import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
+
+/**
+ * Tests if the representation of a route relation is created correctly in the
+ * pt_assistant plugin
+ * 
+ * @author darya
+ *
+ */
+public class RouteRepresentationTest extends AbstractTest {
+	
+	@Test
+	public void correctRouteTest() {
+		
+		/*-
+		 * Create a [correct] route which has:
+		 * stop1 (stop_position)
+		 * way1 (Way)
+		 * stop2(platform, Way)
+		 * way2 (Way)
+		 * stop3 (stop_area)
+		 * way3 (Relation that consists of Ways only)
+		 * stop4 (stop_position)
+		 * stop4 (platform, Node)
+		 * way4 (Way)
+		 * stop5 (platform_exit_only, Relation)
+		 * 
+		 */
+		
+		ArrayList<RelationMember> members = new ArrayList<>();
+		
+		// Create stops:
+		Node n1 = new Node(); 
+		n1.put("name", "Stop1");
+		RelationMember rm1 = new RelationMember("stop_position", n1);
+		members.add(rm1);
+		Way w1 = new Way();
+		w1.put("name", "Stop2");
+		w1.put("highway", "platform");
+		RelationMember rm2 = new RelationMember("platform", w1);
+		members.add(rm2);
+		Relation r1 = new Relation();
+		r1.put("name", "Stop3");
+		RelationMember rm3 = new RelationMember("stop_area", r1);
+		members.add(rm3);
+		Node n2 = new Node();
+		n2.put("name", "Stop4");
+		RelationMember rm4 = new RelationMember("stop_position", n2);
+		members.add(rm4);
+		Node n3 = new Node();
+		n3.put("name", "Stop4");
+		RelationMember rm5 = new RelationMember("platform", n3);
+		members.add(rm5);
+		Relation r2 = new Relation();
+		r2.put("name", "Stop5");
+		r2.put("highway", "platform_exit_only");
+		RelationMember rm6 = new RelationMember("platform_exit_only", r2);
+		members.add(rm6);
+				
+		// Create ways:
+		Way w2 = new Way();
+		RelationMember rm7 = new RelationMember("", w2);
+		members.add(rm7);
+		Way w3 = new Way();
+		RelationMember rm8 = new RelationMember("", w3);
+		members.add(rm8);
+		Relation r3 = new Relation(); // nested relation
+		Way w4 = new Way();
+		Way w5 = new Way();
+		Way w6 = new Way();
+		r3.addMember(new RelationMember("", w4));
+		r3.addMember(new RelationMember("", w5));
+		r3.addMember(new RelationMember("", w6));
+		RelationMember rm9 = new RelationMember("", r3);
+		members.add(rm9);
+		Way w7 = new Way();
+		RelationMember rm10 = new RelationMember("", w7);
+		members.add(rm10);
+		
+
+		
+		Relation route = new Relation();
+		route.setMembers(members);
+		
+		PTRouteDataManager manager = new PTRouteDataManager(route);
+	
+		assertEquals(manager.getPTStopCount(), 5);
+		assertEquals(manager.getPTWayCount(), 4);
+		
+	}
+	
+	@Test
+	public void nestedRelationTest() {
+		
+		// Same as above, but the nested Relation has a Node (only ways are allowed)
+		
+		ArrayList<RelationMember> members = new ArrayList<>();
+		
+		// Create stops:
+		Node n1 = new Node(); 
+		n1.put("name", "Stop1");
+		RelationMember rm1 = new RelationMember("stop_position", n1);
+		members.add(rm1);
+		Way w1 = new Way();
+		w1.put("name", "Stop2");
+		w1.put("highway", "platform");
+		RelationMember rm2 = new RelationMember("platform", w1);
+		members.add(rm2);
+		Relation r1 = new Relation();
+		r1.put("name", "Stop3");
+		RelationMember rm3 = new RelationMember("stop_area", r1);
+		members.add(rm3);
+		Node n2 = new Node();
+		n2.put("name", "Stop4");
+		RelationMember rm4 = new RelationMember("stop_position", n2);
+		members.add(rm4);
+		Node n3 = new Node();
+		n3.put("name", "Stop4");
+		RelationMember rm5 = new RelationMember("platform", n3);
+		members.add(rm5);
+		Relation r2 = new Relation();
+		r2.put("name", "Stop5");
+		r2.put("highway", "platform_exit_only");
+		RelationMember rm6 = new RelationMember("platform_exit_only", r2);
+		members.add(rm6);
+				
+		// Create ways:
+		Way w2 = new Way();
+		RelationMember rm7 = new RelationMember("", w2);
+		members.add(rm7);
+		Way w3 = new Way();
+		RelationMember rm8 = new RelationMember("", w3);
+		members.add(rm8);
+		Relation r3 = new Relation(); // nested relation
+		Way w4 = new Way();
+		Node wrongNode = new Node(); // CHANGED COMPARED TO PREVIOUS TEST
+		Way w6 = new Way();
+		r3.addMember(new RelationMember("", w4));
+		r3.addMember(new RelationMember("platform", wrongNode));
+		r3.addMember(new RelationMember("", w6));
+		RelationMember rm9 = new RelationMember("", r3);
+		members.add(rm9);
+		Way w7 = new Way();
+		RelationMember rm10 = new RelationMember("", w7);
+		members.add(rm10);
+		
+		
+		Relation route = new Relation();
+		route.setMembers(members);
+		
+		boolean thrown = false;
+		String message = "";
+		try {
+			PTRouteDataManager manager = new PTRouteDataManager(route);
+		} catch(IllegalArgumentException e) {
+			thrown = true;
+			message = e.getMessage();
+		}
+		
+		assertTrue(thrown);
+		assertEquals(message, "A route relation member of OsmPrimitiveType.RELATION can only have ways as members");
+		
+	}
+	
+	
+	@Test
+	public void multipleStopElementTest() {
+		
+		// Same as correctRouteTest(), but 
+		
+		ArrayList<RelationMember> members = new ArrayList<>();
+		
+		// Create stops:
+		Node n1 = new Node(); 
+		n1.put("name", "Stop1");
+		RelationMember rm1 = new RelationMember("stop_position", n1);
+		members.add(rm1);
+		Way w1 = new Way();
+		w1.put("name", "Stop2");
+		w1.put("highway", "platform");
+		RelationMember rm2 = new RelationMember("platform", w1);
+		members.add(rm2);
+		Relation r1 = new Relation();
+		r1.put("name", "Stop3");
+		RelationMember rm3 = new RelationMember("stop_area", r1);
+		members.add(rm3);
+		Node n2 = new Node();
+		n2.put("name", "Stop4");
+		RelationMember rm4 = new RelationMember("stop_position", n2);
+		members.add(rm4);
+		Node n3 = new Node();
+		n3.put("name", "Stop4");
+		RelationMember rm5 = new RelationMember("platform", n3);
+		members.add(rm5);
+		Relation r2 = new Relation();
+		r2.put("name", "Stop5");
+		r2.put("highway", "platform_exit_only");
+		RelationMember rm6 = new RelationMember("platform_exit_only", r2);
+		members.add(rm6);
+				
+		// Create ways:
+		Way w2 = new Way();
+		RelationMember rm7 = new RelationMember("", w2);
+		members.add(rm7);
+		Way w3 = new Way();
+		RelationMember rm8 = new RelationMember("", w3);
+		members.add(rm8);
+		Relation r3 = new Relation(); // nested relation
+		Way w4 = new Way();
+		Way w5 = new Way();
+		Way w6 = new Way();
+		r3.addMember(new RelationMember("", w4));
+		r3.addMember(new RelationMember("", w5));
+		r3.addMember(new RelationMember("", w6));
+		RelationMember rm9 = new RelationMember("", r3);
+		members.add(rm9);
+		Way w7 = new Way();
+		RelationMember rm10 = new RelationMember("", w7);
+		members.add(rm10);
+		
+
+		
+		Relation route = new Relation();
+		route.setMembers(members);
+		
+		PTRouteDataManager manager = new PTRouteDataManager(route);
+	
+		assertEquals(manager.getPTStopCount(), 5);
+		assertEquals(manager.getPTWayCount(), 4);
+		
+	}
+	
+
+}
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/GapTestTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/GapTestTest.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/GapTestTest.java	(revision 32296)
@@ -1,3 +1,3 @@
-package org.openstreetmap.josm.plugins.pt_assistant.validation;
+package unit.org.openstreetmap.josm.plugins.pt_assistant.validation;
 
 import static org.junit.Assert.assertEquals;
@@ -12,6 +12,6 @@
 import org.openstreetmap.josm.plugins.pt_assistant.validation.GapTest;
 
-import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
-import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
+import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
+import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
 
 public class GapTestTest extends AbstractTest {
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformAsWayTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformAsWayTest.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformAsWayTest.java	(revision 32296)
@@ -1,3 +1,3 @@
-package org.openstreetmap.josm.plugins.pt_assistant.validation;
+package unit.org.openstreetmap.josm.plugins.pt_assistant.validation;
 
 import static org.junit.Assert.assertEquals;
@@ -12,6 +12,6 @@
 import org.openstreetmap.josm.plugins.pt_assistant.validation.GapTest;
 
-import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
-import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
+import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
+import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
 
 public class PlatformAsWayTest extends AbstractTest{
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformsFirstTestTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformsFirstTestTest.java	(revision 32295)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformsFirstTestTest.java	(revision 32296)
@@ -1,3 +1,3 @@
-package org.openstreetmap.josm.plugins.pt_assistant.validation;
+package unit.org.openstreetmap.josm.plugins.pt_assistant.validation;
 
 import static org.junit.Assert.assertEquals;
@@ -12,6 +12,6 @@
 import org.openstreetmap.josm.plugins.pt_assistant.validation.PlatformsFirstTest;
 
-import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
-import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
+import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
+import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
 
 public class PlatformsFirstTestTest extends AbstractTest {
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/RoadTypeTestTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/RoadTypeTestTest.java	(revision 32296)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/RoadTypeTestTest.java	(revision 32296)
@@ -0,0 +1,45 @@
+package unit.org.openstreetmap.josm.plugins.pt_assistant.validation;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.List;
+
+import org.junit.Test;
+import org.openstreetmap.josm.data.osm.DataSet;
+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.data.validation.TestError;
+import org.openstreetmap.josm.plugins.pt_assistant.validation.RoadTypeTest;
+
+import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
+import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
+
+public class RoadTypeTestTest extends AbstractTest {
+	
+	@Test
+	public void test() {
+		
+		File file = new File(AbstractTest.PATH_TO_ROAD_TYPE_ERROR);
+		DataSet ds = ImportUtils.importOsmFile(file, "testLayer");
+		
+		RoadTypeTest roadTypeTest = new RoadTypeTest();
+		for (Relation r: ds.getRelations()) {
+			roadTypeTest.visit(r);
+		}
+		
+		List<TestError> errors = roadTypeTest.getErrors();
+		assertEquals(errors.size(), 2);
+		
+		for (TestError e: errors) {
+			assertEquals(e.getCode(), RoadTypeTest.ERROR_CODE_ROAD_TYPE);
+			List<OsmPrimitive> highlighted = (List<OsmPrimitive>) e.getHighlighted();
+			Way way = (Way) highlighted.get(0);
+			assertTrue(way.getId() == 8169083 || way.getId() == 8034569);
+		}
+	}
+
+
+}
