if (asXml != null) { // specified
TokenQueue<HtmlTokenType> tq = tokenizeTestInput(
Join.join("\n", htmlInput), asXml, wantsComments);
p = new DomParser(tq, asXml, mq);
} else {
HtmlLexer lexer = new HtmlLexer(fromString(Join.join("\n", htmlInput)));
p = new DomParser(lexer, wantsComments, is, mq);
asXml = lexer.getTreatedAsXml();
}
Node tree = fragment ? p.parseFragment() : p.parseDocument();
List<String> actualParseTree = formatLines(tree);
MoreAsserts.assertListsEqual(expectedParseTree, actualParseTree);