code: public static void checkNotNullOrEmpty(Collection<?> collection, String errorMessage){
          if(collection == null || collection.isEmpty()) {
                  throw new ApplicationException(ApplicationException.Code.INVALID_INPUT, errorMessage);
              }
      }
docs: /*
  This method checks if the collection is null or is empty.
  @param collection input of type {@link Collection}
  @param errorMessage The exception message use if the collection is empty or null
  @throws com.netflix.conductor.core.execution.ApplicationException if input Collection is not valid