MultiPoint implements CoordinateContainer<List<Point>> { public static MultiPoint fromLngLats(@NonNull List<Point> points) { return new MultiPoint(TYPE, null, points); } MultiPoint(String type, @Nullable BoundingBox bbox, List<Point> coordinates); static MultiPoint fromJson(@NonNull String json); static MultiPoint fromLngLats(@NonNull List<Point> points); static MultiPoint fromLngLats(@NonNull List<Point> points, @Nullable BoundingBox bbox); @NonNull @Override String type(); @Nullable @Override BoundingBox bbox(); @NonNull @Override List<Point> coordinates(); @Override String toJson(); static TypeAdapter<MultiPoint> typeAdapter(Gson gson); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void sanity() throws Exception { List<Point> points = new ArrayList<>(); points.add(Point.fromLngLat(1.0, 2.0)); points.add(Point.fromLngLat(2.0, 3.0)); MultiPoint multiPoint = MultiPoint.fromLngLats(points); assertNotNull(multiPoint); }
@Test public void testSerializable() throws Exception { List<Point> points = new ArrayList<>(); points.add(Point.fromLngLat(1.0, 2.0)); points.add(Point.fromLngLat(2.0, 3.0)); BoundingBox bbox = BoundingBox.fromLngLats(1.0, 2.0, 3.0, 4.0); MultiPoint multiPoint = MultiPoint.fromLngLats(points, bbox); byte[] bytes = serialize(multiPoint); assertEquals(multiPoint, deserialize(bytes, MultiPoint.class)); }