// The unsorted list has got almost two elements. Initializes the sorted list with the
// first
List<Point> sortedList = new GeometryList<Point>();
sortedList.add(0, unSortedList.get(0));
final Point firstVertex = this.geometryFactory.createPoint(this.segment
.getCoordinateN(0));
for( int i = 1; i < unSortedList.size(); i++ ) {
Point curPoint = unSortedList.get(i);
double newDistance = DistanceOp.distance(firstVertex, curPoint);
assert newDistance >= 0;
boolean wasInserted = false;
for( int j = 0; j < sortedList.size(); j++ ) {
Point sortedPoint = sortedList.get(j);
double sortedDistance = DistanceOp.distance(firstVertex, sortedPoint);
assert sortedDistance >= 0;
if (newDistance < sortedDistance) {
sortedList = addPointInListFilterEquals(sortedList, j, curPoint);