NodeStateSerializer { public String serialize() throws IOException { StringWriter sw = new StringWriter(); serialize(sw, createBlobSerializer()); closeSerializer(); return sw.toString(); } NodeStateSerializer(NodeState nodeState); String serialize(); void serialize(File dir); String getFileName(); String getBlobDirName(); void setBlobDirName(String blobDirName); void setJsonFileName(String jsonFileName); void setTxtFileName(String txtFileName); void setDepth(int depth); void setMaxChildNodes(int maxChildNodes); void setFilter(String filter); void setFilterFile(File filterFile); void setPath(String path); void setFormat(Format format); void setSerializeBlobContent(boolean serializeBlobContent); void setPrettyPrint(boolean prettyPrint);  }
@Test public void basics() throws Exception{ builder.child("a").setProperty("foo", "bar"); NodeStateSerializer serializer = new NodeStateSerializer(builder.getNodeState()); String json = serializer.serialize(); NodeState nodeState2 = deserialize(json); assertTrue(EqualsDiff.equals(builder.getNodeState(), nodeState2)); }