code: public static MultiPolygon removeCoordinates(MultiPolygon g) {
          ArrayList<Polygon> polys = new ArrayList<Polygon>();
          for (int i = 0; i < g.getNumGeometries(); i++) {
              Polygon poly = (Polygon) g.getGeometryN(i);
              polys.add(removeCoordinates(poly));
          }
          return FACTORY.createMultiPolygon(GeometryFactory.toPolygonArray(polys));
      }
docs: Removes duplicated coordinates within a MultiPolygon.
  
  @param g
  @return