@Test
public void testThatSnapSnapsToTheLineWhenEitherLatOrLongCrossesALine() {

    SimpleWaySnap simpleWaySnap = new SimpleWaySnap(new XYPointFactory(), edges);
    // Longitude crosses a horizontal line.
    NicGeoPoint geoPointIn1 = new XYPoint(50721752, 7061710);
    NicGeoPoint geoPointOut1 = simpleWaySnap.snap(geoPointIn1);
    assertEquals(50721722, geoPointOut1.getLatitudeE6());
    assertEquals(7061710, geoPointOut1.getLongitudeE6());
    // Latitude crosses a vertical line.
    NicGeoPoint geoPointIn2 = new XYPoint(50722081, 7061520);
    NicGeoPoint geoPointOut2 = simpleWaySnap.snap(geoPointIn2);
    assertEquals(50722081, geoPointOut2.getLatitudeE6());
    assertEquals(7061511, geoPointOut2.getLongitudeE6());
}