code: public static boolean isBlank(final String str) {
          if (str == null || str.length() == 0) {
              return true;
          }
          for (final char c : str.toCharArray()) {
              if (!Character.isWhitespace(c)) {
                  return false;
              }
          }
          return true;
      }
docs: <p>Determines whether a given string is <code>null</code>, empty,
  or only contains whitespace. If it contains anything other than
  whitespace then the string is not considered to be blank and the
  method returns <code>false</code>.</p>
  
  @param str The string to test.
  @return <code>true</code> if the string is <code>null</code>, or
  blank.