code: @Override
    public boolean removeClient(long clientId) {
      ClientData clientData = clientsData.get(clientId);
      if (clientData == null) {
        return false;
      }
      dispatcher.removeClient(clientId);
      
      // Iterate over all the sets in which this client figures as subscribed
      // and remove it
      synchronized (subscriptions) {
        for (Set<Long> subscribedSet : clientData.subscriptions) {
          synchronized (subscribedSet) {
            subscribedSet.remove(clientId);
          }
        }
      }
  
      metrics.numTotalSubscriptions.set(numTotalSubscriptions.
          getAndAdd(-clientData.subscriptions.size()));
      
      clientsData.remove(clientId);
      LOG.info("Removed client " + clientData);
      metrics.numRegisteredClients.set(clientsData.size());
      return true;
    }
docs: Removes a client from the internal data structures. This also removes
  the client from all the events to which he subscribed.
  
  @param clientId the client's id for the client we want to remove
  @return true if the client was present in the internal data structures,
  false otherwise.