UsesDirectiveTreeImpl extends ModuleDirectiveTreeImpl implements UsesDirectiveTree { @Override public void accept(TreeVisitor visitor) { visitor.visitUsesDirective(this); } UsesDirectiveTreeImpl(InternalSyntaxToken usesKeyword, TypeTree typeName, InternalSyntaxToken semicolonToken); @Override void accept(TreeVisitor visitor); @Override Kind kind(); @Override TypeTree typeName();  }
@Test void test_BaseTreeVisitor() { CompilationUnitTree cut = JParserTestUtils.parseModule( "open module com.greetings {", " uses org.bar.MyInterface;", " uses org.gul.MyOtherInterface;", "}"); UsesDirectiveVisitor moduleDeclarationVisitor = new UsesDirectiveVisitor(); cut.accept(moduleDeclarationVisitor); assertThat(moduleDeclarationVisitor.visited).isTrue(); assertThat(moduleDeclarationVisitor.directives).hasSize(2); assertThat(moduleDeclarationVisitor.identifiers).containsExactly("com", "greetings", "MyInterface", "MyOtherInterface"); }