@Test public void should_count_top_level_without_natives_and_blocks() throws Exception { String content = "" + "package abc;" + "import xyz;" + "native[] { };" + "foo;" + "class A{};" + "if (a) {};" + "fun foo() {};" + "{};"; assertThat(statements(content)).isEqualTo(2); }
public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } StatementsVisitor(); }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } StatementsVisitor(); int statements(Tree tree); }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } StatementsVisitor(); int statements(Tree tree);  }