code: public static void assureSet(String s, String varName) {
      Objects.requireNonNull(varName);
      if (isEmpty(s.trim())) {
        throw new IllegalArgumentException(varName + " cannot be empty or whitespace only");
      }
    }
docs: Throw exception if the given string is null or empty or only whitespace.