@Test
public void testCreateFromGeometries()
{
final Map<String, Object> properties = new HashMap<>();
properties.put("property", "value");
properties.put("property2", "value2");
final List<GeometryWithProperties> items = new ArrayList<>();
items.add(new GeometryWithProperties(Location.TEST_1, properties));
items.add(new GeometryWithProperties(
new Polygon(Location.TEST_5, Location.TEST_2, Location.TEST_6), properties));
items.add(new GeometryWithProperties(new PolyLine(Location.TEST_5, Location.TEST_2),
properties));
final GeoJsonObject object = new GeoJsonBuilder().createFromGeometriesWithProperties(items);
Assert.assertEquals(
"{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\""
+ ":[-122.009566,37.33531]},\"properties\":{\"property2\":\"value2\",\"property\":\"value\"}},{\"type\":\"Feature\",\"geometry\""
+ ":{\"type\":\"Polygon\",\"coordinates\":[[[-122.031007,37.390535],[-122.028464,37.321628],[-122.033948,37.32544],[-122.031007,37.390535]]]},\"properties\""
+ ":{\"property2\":\"value2\",\"property\":\"value\"}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\""
+ ":[[-122.031007,37.390535],[-122.028464,37.321628]]},\"properties\":{\"property2\":\"value2\",\"property\":\"value\"}}]}",
object.toString());
}