public static <T> T ensureNotEmptyResult(final Optional<T> optValue,
                                             final String msg,
                                             final Object... args) {
        if (optValue == null || optValue.isEmpty()) {
            throw new NotFoundException(LogUtil.message(msg, args));
        }
        return optValue.get();
    }
Ensure value is not empty or throw a {@link NotFoundException}. For use in validating
responses.
stroom-util/src/main/java/stroom/util/rest/RestUtil.java