code: public void cleanUp(RESTRequest request) {
          //We need to loop through the clients but we don't want to synchronize
          //the entire map, which would block new clients from entering and block existing 
          //clients from continuing their work.  So we iterate and possibly remove by just
          //using the built-in concurrency of ConcurrentHashMap.
          final Iterator<Entry<Integer, ClientNotificationArea>> clients = inboxes.entrySet().iterator();
  
          while (clients.hasNext()) {
              Entry<Integer, ClientNotificationArea> client = clients.next();
  
              //Check for time outs
              ClientNotificationArea inbox = client.getValue();
              if (inbox.timedOut()) {
                  //cleanup
                  inbox.cleanUp(request);
  
                  //Emit the warning
                  Tr.warning(tc, "jmx.connector.server.rest.notification.timeout.warning", client.getKey());
  
                  //remove the client inbox from the map (using the Iterator.remove() method)
                  clients.remove();
              }
          }
  
      }
docs: Clean up timed out clients.
  
  TODO: If all clients leave and nobody ever comes up, then we won't cleanup. Need to
  think of a place outside of notifications package that could trigger a cleanup.