PluginDocTree { public void addCommand(String pluginName, CommandDoc command) { checkNotNull(pluginName, "pluginName"); checkNotNull(command, "command"); getCommands(pluginName).add(command); }  void addPlugin(String name, PluginDoc plugin); void addCommand(String pluginName, CommandDoc command); Set<String> getPluginNames(); PluginDoc getPlugin(String name); List<CommandDoc> getCommands(String pluginName);  }
@Test public void testAddCommand() { pluginDocTree.addPlugin("pluginDoc1", pluginDoc1); pluginDocTree.addCommand("pluginDoc1", qavCommand1); List<CommandDoc> commands = pluginDocTree.getCommands("pluginDoc1"); assertThat(commands.size(), is(1)); assertThat(commands.get(0), is(qavCommand1)); }