code: @NullSafe
    public static boolean close(Socket socket) {
      if (socket != null) {
        try {
          socket.close();
          return true;
        }
        catch (IOException ignore) {
        }
      }
  
      return false;
    }
docs: Attempts to close the given {@link Socket} returning a boolean value to indicate whether the operation
  was successful or not.
  
  @param socket {@link Socket} to close.
  @return a boolean value indicating whether the {@link Socket} was successfully closed or not.
  @see java.net.Socket#close()