code: public void ifHasValue(Consumer<? super V> consumer) {
  
          LettuceAssert.notNull(consumer, "Consumer must not be null");
  
          if (hasValue()) {
              consumer.accept(getValue());
          }
      }
docs: If a value is present, invoke the specified {@link java.util.function.Consumer} with the value, otherwise do nothing.
  
  @param consumer block to be executed if a value is present, must not be {@literal null}.