Root extends RootCommandNode<CommandSender> implements Mutable<CommandSender> { @Override public CommandNode<CommandSender> removeChild(String child) { return Commands.remove(this, child); } Root(String prefix, PlatformMap map); @Override void addChild(CommandNode<CommandSender> command); @Override CommandNode<CommandSender> removeChild(String child); @Override void setCommand(@Ignored com.mojang.brigadier.Command<CommandSender> command); @Override void setRedirect(@Ignored CommandNode<CommandSender> destination); PlatformMap map();  }
@Test void removeChild() { when(map.register(literal)).thenReturn(new DispatcherCommand("a", null, null, null, List.of("a1"))); root.addChild(literal); assertEquals(4, root.getChildren().size()); assertEquals(literal, root.removeChild("a")); assertEquals(0, root.getChildren().size()); }