@Test
public void testRemoveDuplicateCoordinates() throws Exception {

        //Test linestring
        Geometry geom = wKTReader.read("LINESTRING(0 8, 1 8 , 3 8,  8  8, 10 8, 20 8)");
        Geometry result = GeometryClean.removeDuplicateCoordinates(geom);
        assertEquals(result.getCoordinates().length, 6);
        //Test duplicate coordinates
        geom = wKTReader.read("LINESTRING(0 8, 1 8 ,1 8, 3 8,  8  8, 10 8, 10 8, 20 8, 0 8)");
        result = GeometryClean.removeDuplicateCoordinates(geom);
        assertEquals(result.getCoordinates().length, 7);
        //Test point
        geom = wKTReader.read("POINT(0 8)");
        result = GeometryClean.removeDuplicateCoordinates(geom);
        assertEquals(result.getCoordinates().length, 1);
        //Test multipoint
        geom = wKTReader.read("MULTIPOINT((0 8), (1 8))");
        result = GeometryClean.removeDuplicateCoordinates(geom);
        assertEquals(result.getCoordinates().length, 2);
        //Test polygon with hole
        geom = wKTReader.read("POLYGON (( 0 0, 10 0, 10 10 , 0 10, 0 0), (2 2, 7 2, 7 2, 7 7, 2 7, 2 2))");
        result = GeometryClean.removeDuplicateCoordinates(geom);
        assertEquals(result.getCoordinates().length, 10);
}