startOnlyRoute.overlapIndex(longerRoute));
Assert.assertEquals(
"The route with only the middle edge should overlap at its 0th and only index", 0,
middleOnlyRoute.overlapIndex(longerRoute));
Assert.assertEquals(
"The route with only the end edge should overlap at its 0th and only index", 0,
endOnlyRoute.overlapIndex(longerRoute));
Assert.assertEquals("The shorter route should overlap at its last (1st) index", 1,
shorterRouteAtBeginning.overlapIndex(longerRoute));
Assert.assertEquals("The same should hold true in reverse", 1,
longerRoute.overlapIndex(shorterRouteAtBeginning));
Assert.assertEquals("The shorter route should overlap at its last (1st) index", 1,
shorterRouteAtEnd.overlapIndex(longerRoute));
Assert.assertEquals("The entire route should overlap at its middle (1st) index", 1,
longerRoute.overlapIndex(shorterRouteAtBeginning));
Assert.assertEquals("The entire route should overlap at its last (2nd) index", 2,
longerRoute.overlapIndex(shorterRouteAtEnd));
Assert.assertEquals("The entire route should overlap at its first (0th) index", 0,
longerRoute.overlapIndex(startOnlyRoute));
Assert.assertEquals("The entire route should overlap at its middle (1st) index", 1,
longerRoute.overlapIndex(middleOnlyRoute));
Assert.assertEquals("The entire route should overlap at its last (2nd) index", 2,
longerRoute.overlapIndex(endOnlyRoute));
Assert.assertEquals("No overlap should happen", -1,
startOnlyRoute.overlapIndex(shorterRouteAtEnd));
Assert.assertEquals("No overlap should happen", -1,
shorterRouteAtEnd.overlapIndex(startOnlyRoute));
Assert.assertEquals("No overlap should happen", -1,
longerRoute.overlapIndex(divergingRoute));