### Question:
DefaultCommand implements ComponentCommand { @Override public Boolean belongsToComponent(String component) { return commandHandlers.stream().anyMatch(handler -> component.equals(handler.getComponentName())); } DefaultCommand(CommandRegistrationCache.RegistrationEntry command, Set<CommandHandler> commandHandlers); @Override Boolean belongsToComponent(String component); @Override boolean belongsToContext(String context); @Override void printOn(Media media);  }### Answer:
@Test public void belongsToComponent() { assertTrue(defaultCommand.belongsToComponent("componentA")); }
@Test public void notBelongsToComponent() { assertFalse(defaultCommand.belongsToComponent("componentB")); }