### Question:
QueryRegistrationCache { public void remove(ClientStreamIdentification clientStreamIdentification) { registrationsPerQuery.forEach((k, v) -> v.removeClient(clientStreamIdentification)); registrationsPerQuery.entrySet().removeIf(v -> v.getValue().isEmpty()); } @Autowired  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector,
                                  BiFunction<Map<String, MetaDataValue>, Set<ClientStreamIdentification>, Set<ClientStreamIdentification>> metaDataBasedNodeSelector);  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector); @EventListener void on(SubscriptionEvents.UnsubscribeQuery event); @EventListener void on(SubscriptionEvents.SubscribeQuery event); void remove(ClientStreamIdentification clientStreamIdentification); void remove(QueryDefinition queryDefinition, ClientStreamIdentification clientId); void add(QueryDefinition queryDefinition, String resultName,
                    QueryHandler queryHandler); Set<QueryHandler> find(String context, QueryRequest request); Collection<QueryHandler> findAll(String context, QueryRequest request); Map<QueryDefinition, Map<String, Set<QueryHandler<?>>>> getAll(); List<QueryRegistration> getForClient(ClientStreamIdentification client); QueryHandler find(String context, QueryRequest request, String clientStreamId); Set<ClientStreamIdentification> getClients(); Set<String> getResponseTypes(QueryDefinition key);  }### Answer:
@Test public void remove() { DirectQueryHandler provider1 = new DirectQueryHandler(dummyStreamObserver, new ClientStreamIdentification(Topology.DEFAULT_CONTEXT, "client"), "component", "client"); queryRegistrationCache.add(new QueryDefinition(Topology.DEFAULT_CONTEXT, "test"), "test", provider1); queryRegistrationCache.remove(provider1.getClientStreamIdentification()); Map<QueryDefinition, Map<String, Set<QueryHandler<?>>>> all = queryRegistrationCache.getAll(); assertEquals(0, all.size()); }