Source:
protected void checkEdgeStability(String editPartName, PointList originalPoints) { ConnectionEditPart connectionEditPart = getEdge(editPartName); assertTrue(connectionEditPart.getFigure() instanceof ViewEdgeFigure); PointList newPoints = ((ViewEdgeFigure) connectionEditPart.getFigure()).getPoints().getCopy(); Assert.assertEquals("The number of bendpoints should be the same", originalPoints.size(), newPoints.size()); assertTrue(connectionEditPart.getModel() instanceof Edge); EObject element = ((Edge) connectionEditPart.getModel()).getElement(); assertTrue(element instanceof DEdge); DEdge dedge = (DEdge) element; EdgeRouting edgeRouting = ((EdgeStyle) dedge.getStyle()).getRoutingStyle(); Point originalFirstPoint = originalPoints.getFirstPoint(); Point newFirstPoint = newPoints.getFirstPoint(); if (originalFirstPoint.equals(newFirstPoint)) { int end = edgeRouting == EdgeRouting.STRAIGHT_LITERAL ? originalPoints.size() - 1 : originalPoints.size() - 2; for (int i = 1; i < end; i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertEquals("The two points should be equal", originalPoint, newPoint); } for (int i = end; i < originalPoints.size(); i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertNotEquals("The two points should be different", originalPoint, newPoint); } } else { int begin = edgeRouting == EdgeRouting.STRAIGHT_LITERAL ? 1 : 2; for (int i = 1; i < begin; i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertNotEquals("The two points should be different", originalPoint, newPoint); } for (int i = begin; i < originalPoints.size(); i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertEquals("The two points should be equal", originalPoint, newPoint); } } }

Target:
protected void checkEdgeStability(String editPartName, PointList originalPoints) { ConnectionEditPart connectionEditPart = getEdge(editPartName); assertTrue(connectionEditPart.getFigure() instanceof ViewEdgeFigure); PointList newPoints = ((ViewEdgeFigure) connectionEditPart.getFigure()).getPoints().getCopy(); Assert.assertEquals("The number of bendpoints should be the same", originalPoints.size(), newPoints.size()); assertTrue(connectionEditPart.getModel() instanceof Edge); EObject element = ((Edge) connectionEditPart.getModel()).getElement(); assertTrue(element instanceof DEdge); DEdge dedge = (DEdge) element; EdgeRouting edgeRouting = ((EdgeStyle) dedge.getStyle()).getRoutingStyle(); Point originalFirstPoint = originalPoints.getFirstPoint(); Point newFirstPoint = newPoints.getFirstPoint(); if (originalFirstPoint.equals(newFirstPoint)) { int end = edgeRouting == EdgeRouting.STRAIGHT_LITERAL ? originalPoints.size() - 1 : originalPoints.size() - 2; for (int i = 1; i < end; i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertEquals("The two points at index " + i + " should be equal", originalPoint, newPoint); } for (int i = end; i < originalPoints.size(); i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertNotEquals("The two points at index " + i + " should be different", originalPoint, newPoint); } } else { int begin = edgeRouting == EdgeRouting.STRAIGHT_LITERAL ? 1 : 2; for (int i = 1; i < begin; i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertNotEquals("The two points at index " + i + " should be different", originalPoint, newPoint); } for (int i = begin; i < originalPoints.size(); i++) { Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertEquals("The two points at index " + i + " should be equal", originalPoint, newPoint); } } }