DXJSON { public static ArrayBuilder getArrayBuilder() { return new ArrayBuilder(); } private  DXJSON(); static JsonNode parseJson(String stringified); static ArrayBuilder getArrayBuilder(); static ObjectBuilder getObjectBuilder(); static T safeTreeToValue(JsonNode json, Class<T> valueType);  }
@Test public void testJsonArrays() { ArrayNode actual1 = DXJSON.getArrayBuilder().add("Foo").addAllStrings(ImmutableList.of("Bar", "Baz")).build(); List<JsonNode> jsonNodeList1 = Lists.newArrayList(actual1); Assert.assertEquals(3, jsonNodeList1.size()); Assert.assertEquals("\"Foo\"", jsonNodeList1.get(0).toString()); Assert.assertEquals("\"Bar\"", jsonNodeList1.get(1).toString()); Assert.assertEquals("\"Baz\"", jsonNodeList1.get(2).toString()); ArrayNode actual2 = DXJSON.getArrayBuilder().build(); List<JsonNode> jsonNodeList2 = Lists.newArrayList(actual2); Assert.assertEquals(0, jsonNodeList2.size()); }