code: public static String checkNotNullNorEmpty(final String reference, final Object errorMessage) {
          if (reference == null) {
              throw new NullPointerException(String.valueOf(errorMessage));
          }
          if (reference.isEmpty()) {
              throw new IllegalArgumentException(String.valueOf(errorMessage));
          }
          return reference;
      }
docs: Ensures that a string reference passed as a parameter to the calling method is not null.
  nor empty.
  
  @param reference    a string reference
  @param errorMessage the exception message to use if the check fails; will be converted to a
  string using {@link String#valueOf(Object)}
  @return the non-null reference that was validated
  @throws NullPointerException     if {@code reference} is null
  @throws IllegalArgumentException if {@code reference} is empty