### Question:
Geom { public static <T extends Geometry> List<T> flatten(GeometryCollection gc) { return flatten(Collections.singletonList((Geometry)gc)); }  static GeomBuilder build(); static Point point(double x, double y); static LineString lineString(double... ord); static Polygon polygon(double... ord); static Iterable<Point> iterate(MultiPoint mp); static Iterable<LineString> iterate(MultiLineString ml); static Iterable<Polygon> iterate(MultiPolygon mp); static Iterable<Geometry> iterate(GeometryCollection gc); static Iterable<LineString> holes(final Polygon p); static Point first(MultiPoint mp); static LineString first(MultiLineString ml); static Polygon first(MultiPolygon mp); static T[] array(GeometryCollection gc, T[] array); static T narrow(GeometryCollection gc); static List<T> flatten(GeometryCollection gc); static List<T> flatten(List<Geometry> gl); static Geometry singlify(Geometry geom); static String json(Geometry g); static PreparedGeometry prepare(Geometry g); static GeometryCollection multi(Geometry g); static void visit(Geometry g, GeometryVisitor v); static Geometry parse(String str); final static GeometryFactory factory; }### Answer:
@Test public void testFlatten() { GeometryCollection gcol = Geom.build() .point(1,1).point() .point(2,3).point(4,5).multiPoint() .toCollection(); List<Point> flat = Geom.flatten(gcol); assertEquals(3, flat.size()); assertEquals(1d, flat.get(0).getX(), 0.1); assertEquals(2d, flat.get(1).getX(), 0.1); assertEquals(4d, flat.get(2).getX(), 0.1); }