@Test
public void testToString() throws Exception {

    CustomVariables cv = new CustomVariables();
    cv.put(1, "name", "value");
    cv.put(2, "name2", "uńicódę");
    String cvJson = cv.toString();
    new JSONObject(cvJson); //Will throw exception if not valid json
    assertTrue(cvJson.contains("\"2\":[\"name2\",\"uńicódę\"]"));
    assertTrue(cvJson.contains("\"1\":[\"name\",\"value\"]"));
}