### Question:
Geom { public static <T extends Geometry> T narrow(GeometryCollection gc) { if (gc.getNumGeometries() == 0) { return (T) gc; } List<Geometry> objects = new ArrayList<>(gc.getNumGeometries()); for (Geometry g : iterate(gc)) { objects.add(g); } return (T) gc.getFactory().buildGeometry(objects); }  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 testNarrow() { GeometryCollection gcol = Geom.build() .point(1, 1).point() .point(2, 2).point() .point(3, 3).point() .toCollection(); assertTrue(Geom.narrow(gcol) instanceof MultiPoint); }