Dispatcher extends CommandDispatcher<CommandSender> implements Listener { public static Dispatcher of(Plugin plugin) { var prefix = plugin.getName().toLowerCase(); var server = ((CraftServer) plugin.getServer()); var map = new SpigotMap(prefix, plugin, (CraftCommandMap) server.getCommandMap()); var root = new Root(prefix, map); var dispatcher = new Dispatcher(server, root); map.dispatcher = dispatcher; server.getPluginManager().registerEvents(dispatcher, plugin); return dispatcher; } protected  Dispatcher(Server server, Root root); static Dispatcher of(Plugin plugin); void register(Map<String, CommandNode<CommandSender>> commands); Literal<CommandSender> register(Literal.Builder<CommandSender> command); void update(); @Override Root getRoot();  }
@Test void of() { reset(manager); var dispatcher = Dispatcher.of(plugin); assertSame(dispatcher, ((SpigotMap) dispatcher.getRoot().map()).dispatcher); }