Link { public static void addLanePair(int fromLane, RoadSegment fromRoadsegment, int toLane, RoadSegment toRoadSegment) { toRoadSegment.setSourceLaneSegmentForLane(fromRoadsegment.laneSegment(fromLane), toLane); fromRoadsegment.setSinkLaneSegmentForLane(toRoadSegment.laneSegment(toLane), fromLane); } private  Link(); static void addLanePair(int fromLane, RoadSegment fromRoadsegment, int toLane, RoadSegment toRoadSegment); static RoadSegment addJoin(RoadSegment sourceRoad, RoadSegment sinkRoad); static void addMerge(RoadSegment fromRoad1, RoadSegment fromRoad2, RoadSegment toRoad); static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2);  }
@Test public final void testAddLanePair() { final int laneCount = 1; final double roadLength = 1000.0; final RoadMapping m = new RoadMappingConcrete(laneCount, roadLength); final RoadSegment r1 = new RoadSegment(m); final RoadSegment r2 = new RoadSegment(m); Link.addLanePair(Lanes.LANE1, r1, Lanes.LANE1, r2); assertEquals(r2, r1.sinkRoadSegment(Lanes.LANE1)); assertEquals(Lanes.LANE1, r1.sinkLane(Lanes.LANE1)); assertEquals(r1, r2.sourceRoadSegment(Lanes.LANE1)); assertEquals(Lanes.LANE1, r2.sourceLane(Lanes.LANE1)); }