@Test
public void testWriteGeometryCollection() {

    Geometry[] geometries = new Geometry[2];
    geometries[0] = GEOMETRY_FACTORY.createPoint(new CustomCoordinateSequence(CoordinateSequenceDimensions.XYZM, "4 6 0 1"));
    geometries[1] = GEOMETRY_FACTORY.createLineString(new CustomCoordinateSequence(CoordinateSequenceDimensions.XYZM, "4 6 0 1,7 10 0 1"));
    Geometry geometry = GEOMETRY_FACTORY.createGeometryCollection(geometries);
    GeometryWrapper geometryWrapper = new GeometryWrapper(geometry, SRS_URI.WGS84_CRS, WKTDatatype.URI, new DimensionInfo(4, 3, 1));
    String expResult = "<" + SRS_URI.WGS84_CRS + "> GEOMETRYCOLLECTION ZM(POINT ZM(4 6 0 1), LINESTRING ZM(4 6 0 1, 7 10 0 1))";
    String result = WKTWriter.write(geometryWrapper);
    //
    //
    assertEquals(expResult, result);
}