code: @Nullable
    @CheckReturnValue
    public static String trimTrailingWhitespaces (@Nullable final String s)
    {
      final int n = getTrailingWhitespaceCount (s);
      return n == 0 ? s : s.substring (0, s.length () - n);
    }
docs: Remove any trailing whitespaces from the passed string.
  
  @param s
  the String to be cut
  @return the original String with all trailing whitespaces removed