code: public static void mergeInstances(Map<TriangulationPoint, TriangulationPoint> uniquePts, List<TriangulationPoint> ptList) {
          for(int idPoint = 0; idPoint < ptList.size(); idPoint++) {
              TriangulationPoint pt = ptList.get(idPoint);
              TriangulationPoint uniquePt = uniquePts.get(pt);
              if(uniquePt == null) {
                  uniquePts.put(pt, pt);
              } else {
                  // Duplicate point
                  ptList.set(idPoint, uniquePt);
              }
          }
      }
docs: Replace points in ptList for all equals object in uniquePts.
  @param uniquePts Map of triangulation points
  @param ptList Point list, updated, but always the same size.