JsonSerializer { public void serialize(NodeState node) { serialize(node, ""); } private  JsonSerializer(
            JsopWriter json, int depth, long offset, int maxChildNodes,
            JsonFilter filter, BlobSerializer blobs, boolean catchExceptions);  JsonSerializer(
            int depth, long offset, int maxChildNodes,
            String filter, BlobSerializer blobs);  JsonSerializer(JsopWriter json,
            int depth, long offset, int maxChildNodes,
            String filter, BlobSerializer blobs);  JsonSerializer(JsopWriter json,
                          int depth, long offset, int maxChildNodes,
                          String filter, BlobSerializer blobs, boolean catchExceptions);  JsonSerializer(JsopWriter json, BlobSerializer blobs);  JsonSerializer(JsopWriter json, String filter, BlobSerializer blobs); void serialize(NodeState node); void serialize(NodeState node, String basePath); void serialize(PropertyState property); void serialize(PropertyState property, Type<?> type, int index); String toString(); static final String DEFAULT_FILTER_EXPRESSION; }
@Test public void childOrder() throws Exception{ NodeBuilder builder = EMPTY_NODE.builder(); builder.child("a"); builder.child("b"); builder.child("c"); List<String> expectedOrder = Arrays.asList("a", "c", "b"); builder.setProperty(":childOrder", expectedOrder, Type.NAMES); NodeState state = builder.getNodeState(); String json = serialize(state); JsopReader reader = new JsopTokenizer(json); List<String> childNames = Lists.newArrayList(); reader.read('{'); do { String key = reader.readString(); reader.read(':'); if (reader.matches('{')) { childNames.add(key); reader.matches('}'); } } while (reader.matches(',')); assertEquals(expectedOrder, childNames); }