@Test void testCancelCallbacks() { CommandCallbackRepository<Object> repository = new CommandCallbackRepository<>(); repository.store("A", createWrapper("A")); repository.store("B", createWrapper("A")); repository.store("C", createWrapper("A")); repository.store("D", createWrapper("B")); assertEquals(4, repository.callbacks().size()); repository.cancelCallbacks("C"); assertEquals(4, repository.callbacks().size()); repository.cancelCallbacks("A"); assertEquals(1, repository.callbacks().size()); assertEquals(3, failCounter); assertEquals(0, successCounter); }
public void cancelCallbacks(A channelId) { cancelCallbacksForChannel(channelId); }
CommandCallbackRepository { public void cancelCallbacks(A channelId) { cancelCallbacksForChannel(channelId); } }
CommandCallbackRepository { public void cancelCallbacks(A channelId) { cancelCallbacksForChannel(channelId); }  }
CommandCallbackRepository { public void cancelCallbacks(A channelId) { cancelCallbacksForChannel(channelId); }  void cancelCallbacks(A channelId); Collection<CommandCallbackWrapper> cancelCallbacksForChannel(A channelId); @SuppressWarnings("unchecked") CommandCallbackWrapper<E, C, R> fetchAndRemove(String callbackId); void store(String callbackId, CommandCallbackWrapper<E, C, R> commandCallbackWrapper); }
CommandCallbackRepository { public void cancelCallbacks(A channelId) { cancelCallbacksForChannel(channelId); }  void cancelCallbacks(A channelId); Collection<CommandCallbackWrapper> cancelCallbacksForChannel(A channelId); @SuppressWarnings("unchecked") CommandCallbackWrapper<E, C, R> fetchAndRemove(String callbackId); void store(String callbackId, CommandCallbackWrapper<E, C, R> commandCallbackWrapper);  }