HoconParser implements ConfigParser<CommentedConfig> { @Override public CommentedConfig parse(Reader reader) { CommentedConfig config = HoconFormat.instance().createConfig(); parse(reader, config, ParsingMode.MERGE); return config; }  @Override ConfigFormat<CommentedConfig> getFormat(); @Override CommentedConfig parse(Reader reader); @Override void parse(Reader reader, Config destination, ParsingMode parsingMode);  }
@Test public void readWriteReadAgain() { File file = new File("test.hocon"); CommentedConfig parsed = new HoconParser().parse(file, FileNotFoundAction.THROW_ERROR); System.out.println("--- parsed --- \n" + parsed); System.out.println("--------------------------------------------"); java.io.StringWriter sw = new StringWriter(); HoconWriter writer = new HoconWriter(); writer.write(parsed, sw); System.out.println("--- written --- \n" + sw); System.out.println("--------------------------------------------"); CommentedConfig reparsed = new HoconParser().parse(new StringReader(sw.toString())); System.out.println("--- reparsed --- \n" + reparsed); assertEquals(parsed, reparsed); }