code: public synchronized void waitForHandlers() throws InterruptedException {
      if (handlers != null) {
        for (int i = 0; i < handlerCount; i++) {
          if (handlers[i] != null) {
            handlers[i].join();
          }
        }
      }
    }
docs: Waits for all RPC handlers to exit. This ensures that no further RPC
  calls would be processed by this server.