@Test
public void testJumpToDifferentCorner() {

    Set<Edge> cornerEdges = new HashSet<Edge>();
    cornerEdges.add(new Edge(createXYPoint(0,0), createXYPoint(0,4)));
    cornerEdges.add(new Edge(createXYPoint(0,0), createXYPoint(4,0)));
    cornerEdges.add(new Edge(createXYPoint(4,4), createXYPoint(0,4)));
    SimpleWaySnap simpleWaySnap = new SimpleWaySnap(new XYPointFactory(), cornerEdges);
    // First point is above the third edge, which is NOT part of the tested corner:
    NicGeoPoint geoPointIn1 = createXYPoint(2,5);
    NicGeoPoint geoPointOut1 = simpleWaySnap.snap(geoPointIn1);
    NicGeoPoint expected1 = createXYPoint(2,4);
    assertEquals(expected1, geoPointOut1);
    // Second point is in the corner and should be snapped to any one of the first two edges:
    NicGeoPoint geoPointIn2 = createXYPoint(1,1);
    NicGeoPoint geoPointOut2 = simpleWaySnap.snap(geoPointIn2);
    NicGeoPoint expected2a = createXYPoint(1, 0);
    NicGeoPoint expected2b = createXYPoint(0,1);
    assertTrue(geoPointOut2.equals(expected2a) || geoPointOut2.equals(expected2b));
    // Third time, from the same pointIn again, should then again stay on the last edge/point:
    NicGeoPoint expected3 = geoPointOut2;
    NicGeoPoint geoPointOut3 = simpleWaySnap.snap(geoPointIn2);
    assertEquals(expected3, geoPointOut3);
}