@Test
public void testLineString() throws Exception {

    Map<String, Object> json = loadJSONResource("linestring.json");
    CoordinateReferenceSystem crs84 = CRS.decode("EPSG:4326", true);
    SimpleFeatureType schema = GeoJSONSchemaDetector.getSchema(json, crs84);
    SimpleFeature f = GeoJSONReader2.toFeature(json, schema);
    assertEquals(2, f.getProperties().size());
    LineString geom = (LineString) f.getDefaultGeometry();
    CoordinateSequence cs = geom.getCoordinateSequence();
    assertEquals(2, cs.size());
    Coordinate c = cs.getCoordinate(0);
    assertEquals(125.6, c.x, 1e6);
    assertEquals(10.1, c.y, 1e6);
    c = cs.getCoordinate(1);
    assertEquals(10.1, c.x, 1e6);
    assertEquals(125.6, c.y, 1e6);
    String name = (String) f.getAttribute("name");
    assertEquals("Dinagat Islands", name);
}