public static Optional<String> nonBlank(final String str) {
        if (isBlankString(str)) {
            return Optional.empty();
        } else {
            return Optional.of(str);
        }
    }
If str is not null/empty/blank then pass it to consumer (if that is not null).
stroom-util-shared/src/main/java/stroom/util/shared/NullSafe.java