@Test
public void visit() throws IOException {

    final CharStream charStream = CharStreams.fromStream(this.getClass().getResourceAsStream("/dart/main.dart"));
    final Dart2Lexer lexer = new Dart2Lexer(charStream);
    lexer.removeErrorListeners();
    final CommonTokenStream stream = new CommonTokenStream(lexer);
    stream.fill();
    final Dart2Parser parser = new Dart2Parser(stream);
    parser.removeErrorListeners();
    final ParseTree root = parser.compilationUnit();
    CustomTreeVisitor customTreeVisitor = new CustomTreeVisitor(new ParseTreeItemVisitor() {
        @Override
        public void apply(ParseTree tree) {
        }
        @Override
        public void fillContext(SensorContext context, AntlrContext antlrContext) {
            assertThat(antlrContext.getTokens().length).isEqualTo(371);
        }
    });
    AntlrContext antlrContext = AntlrUtils.getRequest(IOUtils.toString(this.getClass().getResourceAsStream("/dart/main.dart"), "UTF-8"));
    customTreeVisitor.visit(root);
    customTreeVisitor.fillContext(null, antlrContext);
}