public static <T> void consumeNonBlankString(final T value,
                                                 final Function<T, String> stringGetter,
                                                 final Consumer<String> consumer) {
        // GWT doesn't emulate String::isBlank
        if (value != null && stringGetter != null && consumer != null) {
            final String str = stringGetter.apply(value);

            if (!isBlankString(str)) {
                Objects.requireNonNull(consumer).accept(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