/**
* Tests the characteristics of a multi segment connection.
*/
public void testGetMultiSegmentLineCharacteristics() {
Connection connection = createMultiSegmentConnection();
Point2D p1 = new Point2D.Double(10.0, 5.0);
Point2D p2 = new Point2D.Double(20.0, 5.0);
Point2D p3 = new Point2D.Double(30.0, 5.0);
// end points
assertEquals(p1, connection.getEndPoint1());
assertEquals(p3, connection.getEndPoint2());
// getSegmentAtPoint()
assertNull("no segment should be found here",
connection.getSegmentAtPoint(100.0, 6.0));
Line2D segment1 = connection.getSegmentAtPoint(13.0, 5.0);
assertEquals(p1, segment1.getP1());
assertEquals(p2, segment1.getP2());
Line2D segment2 = connection.getSegmentAtPoint(26.0, 5.0);
assertEquals(p2, segment2.getP1());
assertEquals(p3, segment2.getP2());
System.out.println("dist: " + segment2.ptSegDist(26, 5));
// contains
assertFalse(connection.contains(100, 6));
assertTrue(connection.contains(26, 5));
}