CommentParser extends CommentReader { public void parse() throws IOException { while (this.nextLine()) { if (this.isBlank() || this.isComment()) { this.appendLine(); } else { this.trackComment(); } } this.trackComment(); this.reader.close(); } CommentParser(final YamlConfigurationOptions options, final Reader reader); void parse();  }
@Test void parse() throws IOException { final StringReader reader = new StringReader("# test comment\n" + "test: 'test' # test side comment \n" + "# test comment 2"); final YamlConfiguration configuration = new YamlConfiguration(); final YamlConfigurationOptions options = new TestYamlConfigurationOptions(configuration); final CommentParser parser = new CommentParser(options, reader); parser.parse(); }