code: private void processMessages(int idx) {
          LOG.finest("Processing thread " + idx + " starting...");
          try {
              HTTPExchange exch;
              do {
                  exch = nextExchange(idx);
                  if (exch == null) {
                      break;
                  }
  
                  // Test hook to manipulate what the client sees:
                  ExchangeInterceptor interceptor = exchInterceptor.get();
                  if (interceptor != null) {
                      HTTPExchange newExch = interceptor.interceptExchange(exch);
                      if (newExch == null) {
                          LOG.log(Level.FINE, "Discarding exchange on request "
                                  + "of test hook: RID="
                                  + exch.getRequest().getAttribute(
                                      Attributes.RID));
                          lock.lock();
                          try {
                              exchanges.remove(exch);
                          } finally {
                              lock.unlock();
                          }
                          continue;
                      }
                      exch = newExch;
                  }
  
                  processExchange(idx, exch);
              } while (true);
          } finally {
              LOG.log(Level.FINEST, "Processing thread exiting: " + idx);
          }
  
      }
docs: While we are "connected", process received responses.
  
  This method is run in the processing thread.
  
  @param idx the {@link #procThreads} index of the "RequestProcessor"
  for which this method is executed.