private HtmlParseResult parse(FileObject file) throws ParseException {
    HtmlSource source = new HtmlSource(file);
    HtmlParseResult result = SyntaxAnalyzer.create(source).analyze().parseHtml();

    assertNotNull(result);

    assertNodeOffsets(result.root());

    return result;
  }
  private HtmlParseResult parse(CharSequence code, boolean validateNodes) throws ParseException {
    HtmlSource source = new HtmlSource(code);
    final HtmlParseResult result = SyntaxAnalyzer.create(source).analyze().parseHtml();

    assertNotNull(result);

    if (validateNodes) {
      assertNodeOffsets(result.root());
    }

    return result;
  }