}
else if (geom1 instanceof RingImpl && geom2 instanceof RingImplUnsafe) {
RingImplUnsafe ring1 = (RingImplUnsafe) geom1;
RingImplUnsafe ring2 = (RingImplUnsafe) geom2;
List<DirectPosition> list1 = ring1.asDirectPositions();
List<DirectPosition> list2 = ring2.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());