RoadPath extends GraphPath<RoadPath, RoadSegment, RoadConnection> { @Pure public Direction1D getSegmentDirectionAt(int index) { final RoadSegment sgmt = get(index); assert sgmt != null; final RoadConnection conn = getStartingPointFor(index); assert conn != null; if (conn.equals(sgmt.getBeginPoint())) { return Direction1D.SEGMENT_DIRECTION; } assert conn.equals(sgmt.getEndPoint()); return Direction1D.REVERTED_DIRECTION; } protected  RoadPath(List<RoadSegment> original);  RoadPath();  RoadPath(RoadSegment segment);  RoadPath(RoadSegment segment, RoadConnection starting_point);  RoadPath(RoadPath path); static boolean addPathToPath(RoadPath inside, RoadPath elements); static RoadPath of(List<RoadSegment> original); @Override @Pure Object[] toArray(); @Pure Direction1D getSegmentDirectionAt(int index); @Pure boolean isConnectableTo(RoadPath path); @Pure RoadSegment getConnectableSegmentToFirstPoint(RoadPath path); @Pure RoadSegment getConnectableSegmentToLastPoint(RoadPath path); @Pure boolean isFirstPointConnectableTo(RoadPath path); @Pure boolean isLastPointConnectableTo(RoadPath path); @Pure boolean isCulDeSacWay(); @Pure RoadConnection getFirstCrossRoad(); @Pure CrossRoad getFirstJunctionPoint(); @Pure Iterator<CrossRoad> crossRoads();  }
@Test public void testGetSegmentDirectionAtInt() { RoadPath path = new RoadPath(); path.add(this.segment3, this.segment3.getBeginPoint()); path.add(this.segment4); path.add(this.segment1); path.add(this.segment2); path.add(this.segment6, this.segment6.getEndPoint()); path.add(this.segment8); assertEquals(Direction1D.SEGMENT_DIRECTION, path.getSegmentDirectionAt(0)); assertEquals(Direction1D.SEGMENT_DIRECTION, path.getSegmentDirectionAt(1)); assertEquals(Direction1D.SEGMENT_DIRECTION, path.getSegmentDirectionAt(2)); assertEquals(Direction1D.REVERTED_DIRECTION, path.getSegmentDirectionAt(3)); assertEquals(Direction1D.SEGMENT_DIRECTION, path.getSegmentDirectionAt(4)); assertEquals(Direction1D.REVERTED_DIRECTION, path.getSegmentDirectionAt(5)); }