### Question:
CompositeCommand extends CommandBase { public void unregister(Command command) { registeredCommands.remove(command); } CompositeCommand(Command... commands); void register(Command command); void unregister(Command command); @Override void execute(); @Override double getProgress(); @Override ReadOnlyDoubleProperty progressProperty();  }### Answer:
@Test public void allCommandsAreUnregistered() throws Exception { CompositeCommand compositeCommand = new CompositeCommand(delegateCommand1, delegateCommand2); compositeCommand.unregister(delegateCommand1); compositeCommand.unregister(delegateCommand2); }