code: public static String checkNonEmptyString(final String string, final String name) throws IllegalArgumentException {
      if (string == null || string.isEmpty()) {
        throw new IllegalArgumentException("Expecting a non-empty string for " + name);
      }
      return string;
    }
docs: Enforces that the string is {@linkplain String#isEmpty() not empty}.
  @param string the string to test
  @param name variable name for reporting
  @return {@code string}
  @throws IllegalArgumentException if the string is empty