referenceCoordinates[7][1][1] = coordinates[3];
referenceCoordinates[8][0] = coordinates;
GeometryFactory geometryFactory = GeometryUtils.getGeometryFactory();
CoordinateSequenceFactory coordinateSequenceFactory =
geometryFactory.getCoordinateSequenceFactory();
CoordinateSequence sequence = coordinateSequenceFactory.create(coordinates);
LineString geometry = new LineString(sequence, geometryFactory);
P2<LineString> result;
LineString[][] results = new LineString[9][2];
result = GeometryUtils.splitGeometryAtFraction(geometry, 0);
results[0][0] = result.first;
results[0][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 0.125);
results[1][0] = result.first;
results[1][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 0.25);
results[2][0] = result.first;
results[2][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 0.375);
results[3][0] = result.first;
results[3][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 0.5);
results[4][0] = result.first;
results[4][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 0.625);
results[5][0] = result.first;
results[5][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 0.75);
results[6][0] = result.first;
results[6][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 0.875);
results[7][0] = result.first;
results[7][1] = result.second;
result = GeometryUtils.splitGeometryAtFraction(geometry, 1);
results[8][0] = result.first;
results[8][1] = result.second;
sequence = coordinateSequenceFactory.create(referenceCoordinates[0][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[0][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[0][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[0][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[1][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[1][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[1][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[1][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[2][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[2][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[2][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[2][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[3][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[3][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[3][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[3][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[4][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[4][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[4][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[4][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[5][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[5][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[5][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[5][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[6][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[6][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[6][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[6][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[7][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[7][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[7][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[7][1]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[8][0]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[8][0]);
sequence = coordinateSequenceFactory.create(referenceCoordinates[8][1]);
geometry = new LineString(sequence, geometryFactory);
assertEquals(geometry, results[8][1]);
}