code: public static boolean isEmpty(final String str, final boolean trim) {
  	if (!trim) return isEmpty(str);
  	return str == null || str.trim().length() == 0;
      }
docs: check if string is empty (null or "")
  
  @param str
  @return is empty or not