code: public static MultiPolygon removeDuplicateCoordinates(MultiPolygon multiPolygon, double tolerance) throws SQLException {
          ArrayList<Polygon> polys = new ArrayList<Polygon>();
          for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
              Polygon poly = (Polygon) multiPolygon.getGeometryN(i);
              polys.add(removeDuplicateCoordinates(poly, tolerance));
          }
          return FACTORY.createMultiPolygon(GeometryFactory.toPolygonArray(polys));
      }
docs: Removes duplicated coordinates within a MultiPolygon.
  
  @param multiPolygon
  @param tolerance to delete the coordinates
  @return
  @throws java.sql.SQLException