UserInputEvaluation implements CommandRegistry { @Override public void registerCommand(Command command) { commands.put(command.getCommandName(), command); } UserInputEvaluation(); void setProvisioning(Provisioning provisioning); String[] commands(); @Override void registerCommand(Command command); @Override void unregisterCommand(Command command); @Override Command getCommand(String commandName); void evaluate(String userInput);  }
@Test public void registerCommand() { assertThat(userInputEvaluation.commands(), not(hasItemInArray("mycommand"))); userInputEvaluation.registerCommand(new CommandImpl("mycommand", null, "")); assertThat(userInputEvaluation.commands(), hasItemInArray("mycommand")); }