MetadataTranslater { public static String translate(Survey survey) throws Exception { return toJson(survey).toString(); }  static String translate(Survey survey); static void translateAndUpdate(Context context, Survey survey, String string); static void translateAndUpdate(
            Context context,
            Survey survey,
            String string,
            Set<String> surveyNamesNotToLoad); static JSONObject toJson(Survey survey); static List<JSONArray> toListOfArrays(JSONArray array); static final String CONNECTIONS_TAG; static final String ACTIVE_STATION_TAG; }
@Test public void testActiveStationIsTranslatedToJson() throws Exception { Survey survey = new Survey("test"); String translated = MetadataTranslater.translate(survey); Assert.assertEquals("{\"active-station\":\"1\",\"connections\":{}}", translated); }
@Test public void testConnectedSurveyIsTranslatedToJson() throws Exception { Survey survey = new Survey("first"); Survey connectedSurvey = new Survey("connected"); connectTwoSurveys(survey, survey.getOrigin(), connectedSurvey, connectedSurvey.getOrigin()); String translated = MetadataTranslater.translate(survey); Assert.assertEquals( "{\"active-station\":\"1\",\"connections\":{\"1\":[[\"connected\",\"1\"]]}}", translated); }