GeometryFactory factory = new GeometryFactory();
LineString[] line = new LineString[4];
// first test: 2 overlapping lines, overlap test fails?
line[0] = factory.createLineString(new Coordinate[]{new Coordinate(10, 10),
new Coordinate(20, 20),});
line[1] = factory.createLineString(new Coordinate[]{new Coordinate(15, 15),
new Coordinate(25, 25),});
assertTrue(line[0].overlaps(line[1])); // just checking :)
// second test: does this validation test for self-overlaps? (it shouldn't)
line[2] = factory.createLineString(new Coordinate[]{new Coordinate(50, 50),
new Coordinate(60, 50), new Coordinate(55, 50),});