code: @Override
      public boolean validateObject(HostAndPort hostAndPort, PooledObject<SocketOutputStream> socketOutputStreamRef) {
          Socket socket = socketOutputStreamRef.getObject().getSocket();
          return socket.isConnected()
                  && socket.isBound()
                  && !socket.isClosed()
                  && !socket.isInputShutdown()
                  && !socket.isOutputShutdown();
      }
docs: Defensive approach: we test all the "<code>Socket.isXXX()</code>" flags.