TurfMeta { public static Point getCoord(Feature obj) { if (obj.geometry() instanceof Point) { return (Point) obj.geometry(); } throw new TurfException("A Feature with a Point geometry is required."); } private  TurfMeta(); @NonNull static List<Point> coordAll(@NonNull Point point); @NonNull static List<Point> coordAll(@NonNull MultiPoint multiPoint); @NonNull static List<Point> coordAll(@NonNull LineString lineString); @NonNull static List<Point> coordAll(@NonNull Polygon polygon, @NonNull boolean excludeWrapCoord); @NonNull static List<Point> coordAll(@NonNull MultiLineString multiLineString); @NonNull static List<Point> coordAll(@NonNull MultiPolygon multiPolygon,
                                     @NonNull boolean excludeWrapCoord); @NonNull static List<Point> coordAll(@NonNull Feature feature,
                                     @NonNull boolean excludeWrapCoord); @NonNull static List<Point> coordAll(@NonNull FeatureCollection featureCollection,
                                     @NonNull boolean excludeWrapCoord); static Point getCoord(Feature obj);  }
@Test public void testInvariantGetCoord() { String jsonFeature = "{type: 'Feature', geometry: {type: 'Point', coordinates: [1, 2]}}"; assertEquals(TurfMeta.getCoord(Feature.fromJson(jsonFeature)), Point.fromLngLat(1, 2)); }
@Test public void wrongFeatureGeometryForGetCoordThrowsException() throws TurfException { thrown.expect(TurfException.class); thrown.expectMessage(startsWith("A Feature with a Point geometry is required.")); TurfMeta.getCoord(Feature.fromGeometry(LineString.fromLngLats(Arrays.asList( Point.fromLngLat(0, 9), Point.fromLngLat(0, 10) )))); }