code: @Nullable
    public static Object unwrapOptional(@Nullable final Object obj) {
      if (obj instanceof Optional) {
        final Optional<?> optional = (Optional<?>) obj;
        if (!optional.isPresent()) {
          return null;
        }
        final Object result = optional.get();
        Assert.isTrue(!(result instanceof Optional), "Multi-level Optional usage not supported");
        return result;
      }
      return obj;
    }
docs: Unwrap the given object which is potentially a {@link java.util.Optional}.
  
  @param obj the candidate object
  @return either the value held within the {@code Optional}, {@code null} if the {@code Optional}
  is empty, or simply the given object as-is
  @since 5.0