@Test
public void testDistance() {

  final LineSegment3 seg1 = new LineSegment3(Vector3.ZERO, Vector3.UNIT_Z, 1.0);
  final Vector3 store = new Vector3();
  assertTrue(16.0 == seg1.distanceSquared(new Vector3(0, 0, 5), store));
  assertEquals(Vector3.UNIT_Z, store);
  assertTrue(9.0 == seg1.distanceSquared(new Vector3(0, 0, -4), store));
  assertEquals(Vector3.NEG_UNIT_Z, store);
  assertTrue(4.0 == seg1.distanceSquared(new Vector3(2, 0, 0), store));
  assertEquals(Vector3.ZERO, store);
  assertTrue(1.0 == seg1.distanceSquared(Vector3.NEG_UNIT_X, null));
}