code: public synchronized void add(SocketBox sb) {
  
          int status = ((ManagedSocketBox) sb).getStatus();
  
          if (allSockets.containsKey(sb)) {
              throw new IllegalArgumentException("This socket already exists in the socket pool.");
          }
  
          allSockets.put(sb, sb);
  
          if (status == ManagedSocketBox.FREE) {
              if (freeSockets.containsKey(sb)) {
                  throw new IllegalArgumentException("This socket already exists in the pool of free sockets.");
              }
  
              logger.debug("adding a free socket");
              freeSockets.put(sb, sb);
          } else {
              if (busySockets.containsKey(sb)) {
                  throw new IllegalArgumentException("This socket already exists in the pool of busy sockets.");
              }
  
              logger.debug("adding a busy socket");
              busySockets.put(sb, sb);
          }
      }
docs: add socketBox to the pool. Depending on its state, it will be added to free or busy sockets.