code: public static String notEmptyIfNotNull(String value, String name, String info) {
          if (value == null) {
              return value;
          }
  
          if (value.trim().length() == 0) {
              throw new IllegalArgumentException(name + " cannot be empty" + (info == null ? "" : ", " + info));
          }
          return value.trim();
      }
docs: Check that a string is not empty if its not null.
  
  @param value value.
  @param name parameter name for the exception message.
  @return the given value.