// Geometry g = wkt
// .read("LINESTRING(1.0 6.0,5.999998414659173 1.0039816335536662,1.0079632645824341 -3.999993658637697,-3.9999857319385903 0.9880551094385923,1.0 6.0)");
// LineString ls = (LineString) g;
Geometry g2 = wkt
.read("LINESTRING(-2.639991350383829 -1.7999950537374092,-1.8399918576928131 -1.7999950537374092,-1.8399918576928131 -0.9999955610463935,-2.639991350383829 -0.9999955610463935,-2.639991350383829 -1.7999950537374092)");
LineString ls2 = (LineString) g2;
Geometry g3 = wkt
.read("LINESTRING(-2.639991350383829 -1.7999950537374092,-1.8399918576928131 -1.7999950537374092,-1.8399918576928131 -0.9999955610463935,-2.639991350383829 -0.9999955610463935)");
Geometry g4 = wkt
.read("LINESTRING(-2.639991350383829 -0.9999955610463935,-2.639991350383829 -1.7999950537374092)");
LineString ls4 = (LineString) g4;
if (!g3.isValid())
throw new GeometryException();
if (!g4.isValid())
throw new GeometryException();