### Question:
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); }  static JSONObject toGeoJson(RoutingRequest rreq, RouteResult[] routeResult); JSONObject toGeoJson(IsochroneRequest rreq, RouteResult[] routeResults); static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap); static JSONObject addProperties(DefaultFeatureCollection defaultFeatureCollection, Map<String, Map<String, Object>> featurePropertiesMap, Map<String, Object> defaultFeatureCollectionProperties); static final String KEY_ROUTES; static final String KEY_FEATURES; static final String KEY_PROPERTIES; }### Answer:
@Test public void testAddProperties() throws Exception { JSONObject expectedJSON = new JSONObject("{\"geometry\":{\"coordinates\":[[1,1],[1,1],[1,1]],\"type\":\"LineString\"},\"id\":\"" + routingFeatureID + "\",\"type\":\"Feature\",\"properties\":{\"bbox\":[1,1,1,1],\"way_points\":[1,1],\"segments\":[1]}}"); JSONObject resultJSON = GeoJsonResponseWriter.addProperties(routingFeature, featurePropertiesMap); JSONAssert.assertEquals(expectedJSON, resultJSON, JSONCompareMode.NON_EXTENSIBLE); }
@Test public void testAddProperties1() throws Exception { JSONObject expectedJSON = new JSONObject("{\"features\":[{\"geometry\":{\"coordinates\":[[1,1],[1,1],[1,1]],\"type\":\"LineString\"},\"id\":\"" + routingFeatureID + "\",\"type\":\"Feature\",\"properties\":{\"bbox\":[1,1,1,1],\"way_points\":[1,1],\"segments\":[1]}}],\"bbox\":[1,1,1,1],\"type\":\"FeatureCollection\",\"info\":[1]}"); JSONObject resultJSON = GeoJsonResponseWriter.addProperties(defaultFeatureCollection, featurePropertiesMap, defaultFeatureCollectionProperties); JSONAssert.assertEquals(expectedJSON, resultJSON, JSONCompareMode.NON_EXTENSIBLE); }