VectorDataNodeReader { static boolean isClosedPolygon(List<Coordinate> coordList) { final double firstX = coordList.get(0).x; final double firstY = coordList.get(0).y; final double lastX = coordList.get(coordList.size() - 1).x; final double lastY = coordList.get(coordList.size() - 1).y; return (firstX == lastX && firstY == lastY); } private  VectorDataNodeReader(String sourceName, Product product, Reader reader, FeatureUtils.FeatureCrsProvider crsProvider,
                                 PlacemarkDescriptorProvider placemarkDescriptorProvider, boolean convertToVertices, char delimiterChar); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, ProgressMonitor pm); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, boolean convertToVertices, ProgressMonitor pm);  }
@Test public void testIsClosedPolygon() throws Exception { List<Coordinate> coordList = new ArrayList<Coordinate>(5); coordList.add(new Coordinate(1.0, 2.0)); coordList.add(new Coordinate(2.0, 3.0)); coordList.add(new Coordinate(3.0, 4.0)); coordList.add(new Coordinate(4.0, 5.0)); coordList.add(new Coordinate(5.0, 6.0)); assertFalse(VectorDataNodeReader.isClosedPolygon(coordList)); coordList.clear(); coordList.add(new Coordinate(1.6483957603, 2.49567562549)); coordList.add(new Coordinate(2.0, 3.0)); coordList.add(new Coordinate(3.0, 4.0)); coordList.add(new Coordinate(4.0, 5.0)); coordList.add(new Coordinate(1.6483957603, 2.49567562549)); assertTrue(VectorDataNodeReader.isClosedPolygon(coordList)); }