code: public LineString getLineString(Geometry geometry) {
  		if (geometry instanceof MultiLineString) {
  			if (geometryIndex >= 0 && geometryIndex < geometry.getNumGeometries()) {
  				return getLinearRing(geometry.getGeometryN(geometryIndex));
  			}
  		} else if (geometry instanceof LineString) {
  			return (LineString) geometry;
  		}
  		return getLinearRing(geometry);
  	}
docs: Returns a LineString or LinearRing that is described by this index.
  
  @param geometry
  The original geometry.
  @return A LineString or LinearRing.