}
else if (geom1 instanceof CurveImpl && geom2 instanceof CurveImpl) {
CurveImpl curve1 = (CurveImpl) geom1;
CurveImpl curve2 = (CurveImpl) geom2;
List<DirectPosition> list1 = curve1.asDirectPositions();
List<DirectPosition> list2 = curve2.asDirectPositions();
Iterator<DirectPosition> iterator1 = list1.iterator();
Iterator<DirectPosition> iterator2 = list2.iterator();
while (iterator1.hasNext() && iterator2.hasNext()) {
PointImpl p1 = new PointImpl( iterator1.next());
PointImpl p2 = new PointImpl( iterator2.next());