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 32302)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java	(revision 32303)
@@ -6,4 +6,5 @@
 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.utils.RouteUtils;
 
@@ -61,4 +62,30 @@
 	}
 	
+	/**
+	 * Assigns the given way to a PTWay of this route relation.
+	 * @param inputWay Way to be assigned to a PTWAy of this route relation
+	 * @return PTWay that contains the geometry of the inputWay, null if not found
+	 */
+	public PTWay getPTWay(Way inputWay) {
+		
+		for (PTWay curr: ptways) {
+			
+			if (curr.isWay() && curr.getWays().get(0) == inputWay) {
+				return curr;
+			}
+			
+			if (curr.isRelation()) {
+				for (RelationMember rm: curr.getRelation().getMembers()) {
+					Way wayInNestedRelation = rm.getWay();
+					if (wayInNestedRelation == inputWay) {
+						return curr;
+					}
+				}
+			}
+		}
+		
+		return null; // if not found
+	}
+	
 	public List<PTStop> getPTStops() {
 		return this.ptstops;
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 32302)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java	(revision 32303)
@@ -20,5 +20,5 @@
 		super(other);
 
-		if (other.getRole().equals("stop_position") && other.getType().equals(OsmPrimitiveType.NODE)) {
+		if (other.getRole().equals("stop") && other.getType().equals(OsmPrimitiveType.NODE)) {
 			this.stopPosition = other.getNode();
 		} else if (other.getRole().equals("platform") || other.getRole().equals("platform_entry_only")
@@ -27,4 +27,12 @@
 		} else if (other.getRole().equals("stop_area") && other.getType().equals(OsmPrimitiveType.RELATION)) {
 			this.stopArea = other.getRelation();
+			for (RelationMember rm: stopArea.getMembers()) {
+				if (rm.getRole().equals("stop") && rm.isNode()) {
+					this.stopPosition = rm.getNode();
+				}
+				if (rm.getRole().equals("platform") || rm.getRole().equals("platform_entry_only") || rm.getRole().equals("platform_exit_only")) {
+					this.platform = rm.getMember();
+				}
+			}
 		} else {
 			throw new IllegalArgumentException("The RelationMember type does not match its role");
@@ -50,5 +58,5 @@
 
 		// add stop position:
-		if (member.getRole().equals("stop_position")) {
+		if (member.getRole().equals("stop")) {
 			if (member.getType().equals(OsmPrimitiveType.NODE) && stopPosition == null) {
 				this.stopPosition = member.getNode();
@@ -70,4 +78,12 @@
 			if (stopArea == null) {
 				stopArea = member.getRelation();
+				for (RelationMember rm: stopArea.getMembers()) {
+					if (rm.getRole().equals("stop") && rm.isNode()) {
+						this.stopPosition = rm.getNode();
+					}
+					if (rm.getRole().equals("platform") || rm.getRole().equals("platform_entry_only") || rm.getRole().equals("platform_exit_only")) {
+						this.platform = rm.getMember();
+					}
+				}
 				return true;
 			}
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 32302)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTWay.java	(revision 32303)
@@ -63,4 +63,25 @@
 		return this.ways;
 	}
+	
+
+	/**
+	 * Determines if this PTWay is modeled by an OsmPrimitiveType.WAY
+	 */
+	public boolean isWay() {
+		if (this.getType().equals(OsmPrimitiveType.WAY)) {
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Determines if this PTWay is modeled by an OsmPrimitieType.RELATION (i.e. this is a nested relation)
+	 */
+	public boolean isRelation() {
+		if (this.getType().equals(OsmPrimitiveType.RELATION)) {
+			return true;
+		}
+		return false;
+	}
 
 }
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 32302)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java	(revision 32303)
@@ -1,5 +1,4 @@
 package org.openstreetmap.josm.plugins.pt_assistant.utils;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -8,6 +7,7 @@
 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.Way;
+import org.openstreetmap.josm.plugins.pt_assistant.data.PTStop;
+import org.openstreetmap.josm.plugins.pt_assistant.data.PTWay;
 
 /**
@@ -19,33 +19,46 @@
  *
  */
-public final class StopToWayAssigner {
+public class StopToWayAssigner {
 
-	private static HashMap<Long, Way> stopToWay = new HashMap<>();
-
-	private StopToWayAssigner(Relation r) {
-		// Hide default constructor for utils classes
+	/* contains assigned stops */
+	private static HashMap<PTStop, PTWay> stopToWay = new HashMap<>();
+	
+	/* contains all PTWays of the route relation for which this assigner was created */
+	private List<PTWay> ptways;
+	
+	public StopToWayAssigner(List<PTWay> ptways) {
+		this.ptways = ptways;
 	}
 
-	public static Way getWay(OsmPrimitive stop, Relation route) {
-		if (stopToWay.containsKey(stop.getId())) {
-			return stopToWay.get(stop.getId());
+	public PTWay get(PTStop stop) {
+		
+		// 1) Search if this stop has already been assigned:
+		if (stopToWay.containsKey(stop)) {
+			return stopToWay.get(stop);
 		}
-
-		if (stop.getType().equals(OsmPrimitiveType.NODE)) {
-			List<OsmPrimitive> referrers = stop.getReferrers();
-			List<Way> referredWays = new ArrayList<>();
-			for (OsmPrimitive referrer : referrers) {
-				if (referrer.getType().equals(OsmPrimitiveType.WAY)) {
-					referredWays.add((Way) referrer);
+		
+		// 2) Search if the stop has a stop position:
+		Node stopPosition = stop.getStopPosition();
+		if (stopPosition != null) {
+			
+			// search in the referrers:
+			List<OsmPrimitive> referrers = stopPosition.getReferrers();
+			for (OsmPrimitive referredPrimitive: referrers) {
+				if (referredPrimitive.getType().equals(OsmPrimitiveType.WAY)) {
+					Way referredWay = (Way) referredPrimitive;
+					for (PTWay ptway: ptways) {
+						if (ptway.getWays().contains(referredWay)) {
+							stopToWay.put(stop, ptway);
+							return ptway;
+						}
+					}
 				}
 			}
-			if (stop.hasTag("public_transport", "stop_position")) {
-				// TODO
-				Node n = (Node) stop;
-			}
+			
 		}
+		
+	   // 3) Run the growing-bounding-boxes algorithm:
+		// TODO
 
-		// TODO: algorithm with growing bounding boxes
-		// TODO: if found, add to
 		return null;
 	}
@@ -53,8 +66,8 @@
 	/**
 	 * Remove a map entry
-	 * 
+	 * FIXME: keys should be PTStop
 	 * @param stopId
 	 */
-	public static void removeStopKey(long stopId) {
+	public static void removeStopKey(Long stopId) {
 		Long id = new Long(stopId);
 		if (stopToWay.containsKey(id)) {
Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java	(revision 32302)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java	(revision 32303)
@@ -32,4 +32,6 @@
 	public static final int ERROR_CODE_ROAD_TYPE = 3721;
 	public static final int ERROR_CODE_DIRECTION = 3731;
+	public static final int ERROR_CODE_END_STOP = 3141;
+	public static final int ERROR_CODE_SPLIT_WAY = 3142;
 	
 	public PTAssitantValidatorTest() {
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 32302)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java	(revision 32303)
@@ -1,15 +1,20 @@
 package org.openstreetmap.josm.plugins.pt_assistant.validation;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 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.data.validation.Severity;
 import org.openstreetmap.josm.data.validation.Test;
+import org.openstreetmap.josm.data.validation.TestError;
 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;
+import org.openstreetmap.josm.plugins.pt_assistant.utils.StopToWayAssigner;
 
 /**
@@ -22,31 +27,80 @@
 public class SegmentChecker extends Checker {
 
-	/*
-	 * PTRouteSegments that have been validated and are correct. They need to
-	 * accessible
-	 */
+	/* PTRouteSegments that have been validated and are correct */
 	private static List<PTRouteSegment> correctSegments = new ArrayList<PTRouteSegment>();
 
+	/* Manager of the PTStops and PTWays of the current route */
 	private PTRouteDataManager manager;
+
+	/* Assigns PTStops to nearest PTWays and stores that correspondense */
+	private StopToWayAssigner assigner;
 
 	public SegmentChecker(Relation relation, Test test) {
 
 		super(relation, test);
-		
+
 		this.manager = new PTRouteDataManager(relation);
+		this.assigner = new StopToWayAssigner(manager.getPTWays());
 
 	}
 
-	private void performEndstopTest() {
-		
+	public void performFirstStopTest() {
+
+		performEndStopTest(manager.getFirstStop());
+
+	}
+
+	public void performLastStopTest() {
+
+		performEndStopTest(manager.getLastStop());
+
+	}
+
+	private void performEndStopTest(PTStop endStop) {
 		if (manager.getPTStopCount() < 2) {
-			// it does not make sense to check a route that has less than 2 stops
+			// 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.
+
+		if (endStop.getStopPosition() == null) {
+			List<Relation> primitives = new ArrayList<>(1);
+			primitives.add(relation);
+			List<OsmPrimitive> highlighted = new ArrayList<>(1);
+			highlighted.add(endStop.getPlatform());
+			TestError e = new TestError(this.test, Severity.WARNING,
+					tr("PT: Route should start and end with a stop_position"),
+					PTAssitantValidatorTest.ERROR_CODE_END_STOP, primitives, highlighted);
+			this.errors.add(e);
+			return;
+		}
+
+		PTWay endWay = assigner.get(endStop);
+
+		boolean found = false;
+		List<Way> primitivesOfEndWay = endWay.getWays();
+		for (Way primitiveWay : primitivesOfEndWay) {
+			if (primitiveWay.firstNode() == endStop.getStopPosition()
+					|| primitiveWay.lastNode() == endStop.getStopPosition()) {
+				found = true;
+			}
+
+		}
+
+		if (!found) {
+			List<Relation> primitives = new ArrayList<>(1);
+			primitives.add(relation);
+			List<OsmPrimitive> highlighted = new ArrayList<>();
+			for (Way w : endWay.getWays()) {
+				if (w.getNodes().contains(endStop.getStopPosition())) {
+					highlighted.add(w);
+				}
+			}
+			TestError e = new TestError(this.test, Severity.WARNING,
+					tr("PT: First or last way needs to be split"),
+					PTAssitantValidatorTest.ERROR_CODE_SPLIT_WAY, primitives, highlighted);
+			this.errors.add(e);
+		}
+
 	}
 
