code: public static boolean isWhitespace(CharSequence string) {
          if (string == null) {
              return true;
          }
          return StringUtil.trimToNull(string.toString()) == null;
      }
docs: Returns true if the given string only consists of whitespace characters (null-safe)
  @param string the string to test
  @return true if the string is null or only consists of whitespaces.