@Override
    public void unregisterClient(Client client, IAsyncResultHandler<Void> resultHandler) {
        String clientIndex = getClientIndex(client);
        objectMap.get(clientIndex, handleSuccessfulResult(resultHandler, oldClientRaw -> {
            Client oldClient = (Client) oldClientRaw;
            if (oldClient == null) {
                Exception ex = new ClientNotFoundException(Messages.i18n.format("InMemoryRegistry.ClientNotFound"));
                resultHandler.handle(AsyncResultImpl.create(ex));
            } else {
                Future<Object> future1 = Future.future();
                Future<Object> future2 = Future.future();

                objectMap.remove(clientIndex, future1.completer());
                objectMap.remove(oldClient.getApiKey(), future2.completer());

                CompositeFuture.all(future1, future2).setHandler(handleCompositeResult(resultHandler));
            }
        }));
    }
@author Marc Savy {@literal <marc@rhymewithgravy.com>}
gateway/engine/vertx-shareddata/src/main/java/io/apiman/gateway/engine/vertx/shareddata/SharedGlobalDataRegistry.java