class GeometryClean {

        public static Geometry removeDuplicateCoordinates(Geometry geom) {
                if (geom.isEmpty()) {
                        return geom;
                } else if (geom instanceof Point || geom instanceof MultiPoint) {
                        return geom;
                } else if (geom instanceof LineString) {
                        return removeDuplicateCoordinates((LineString) geom);
                } else if (geom instanceof Polygon) {
                        return removeDuplicateCoordinates((Polygon) geom);
                } else if (geom instanceof GeometryCollection) {
                        return removeDuplicateCoordinates((GeometryCollection) geom);
                }
                return null;
        }

        private  GeometryClean();

}