public static Geometry lineMerge(Geometry geom, GeometryFactory factory) {
        LineMerger merger = new LineMerger();
        merger.add(geom);
        Collection lines = merger.getMergedLineStrings();
        return factory.buildGeometry(lines);
    }
public static Geometry lineMerge ( Geometry geom , GeometryFactory factory ) { LineMerger merger = new LineMerger ( ) ; merger . add ( geom ) ; Collection lines = merger . getMergedLineStrings ( ) ; return factory . buildGeometry ( lines ) ; }
A method to merge a geometry to a set of linestring
@param geom
@param factory
@return