Convert the raw Higher Kinded Type for OptionalKind types into the OptionalKind type definition class

@param future HKT encoded list into a OptionalKind
@return OptionalKind
14431
public static <T> OptionalKind<T> narrow(final Higher<optional, T> future) {
    return (OptionalKind<T>)future;
  }
1230839
public final <T> Optional<T> getValue(Class<T> type) {
        return getValue(ConversionContext.of(type));
    }
93642
@Override
    public <R1, R> Future<R> forEach2(Function<? super T, ? extends MonadicValue<R1>> value1,
                                      BiFunction<? super T, ? super R1, Boolean> filterFunction,
                                      BiFunction<? super T, ? super R1, ? extends R> yieldingFunction) {
        return (Future<R>)MonadicValue.super.forEach2(value1, filterFunction, yieldingFunction);
    }
938544
public static Matcher<ClassTree> nestingKind(final NestingKind kind) {
    return new Matcher<ClassTree>() {
      @Override
      public boolean matches(ClassTree classTree, VisitorState state) {
        ClassSymbol sym = ASTHelpers.getSymbol(classTree);
        return sym.getNestingKind() == kind;
      }
    };
  }
1148922
public static <T> @NonNull CompletableFuture<Optional<T>> emptyOptionalFuture() {
    return CompletableFuture.completedFuture(Optional.empty());
  }
291310
public JSType createOptionalNullableType(JSType type) {
    return createUnionType(type, getNativeType(JSTypeNative.VOID_TYPE),
        getNativeType(JSTypeNative.NULL_TYPE));
  }
366393
public static final SerIterable sortedSet(final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
        final SortedSet<Object> coll = new TreeSet<>();
        return set(valueType, valueTypeTypes, coll);
    }
676938
private static Object getFutureValue(ListenableFuture<?> future) {
    Object valueToSet;
    if (future instanceof TrustedFuture) {
      // Break encapsulation for TrustedFuture instances since we know that subclasses cannot
      // override .get() (since it is final) and therefore this is equivalent to calling .get()
      // and unpacking the exceptions like we do below (just much faster because it is a single
      // field read instead of a read, several branches and possibly creating exceptions).
      return ((AbstractFuture<?>) future).value;
    } else {
      // Otherwise calculate valueToSet by calling .get()
      try {
        Object v = getDone(future);
        valueToSet = v == null ? NULL : v;
      } catch (ExecutionException exception) {
        valueToSet = new Failure(exception.getCause());
      } catch (CancellationException cancellation) {
        valueToSet = new Cancellation(false, cancellation);
      } catch (Throwable t) {
        valueToSet = new Failure(t);
      }
    }
    return valueToSet;
  }
1298223
public Kind getKind() {
        Opcode opcode = getOpcode();
        return (opcode != null ? opcode.kind : Kind.UNKNOWN);
    }
342393
public static <T> TreeSet<T> newSortedSet(@Nullable Comparator<? super T> comparator) {
		return Sets.newTreeSet(comparator);
	}
94785
public static <T> Future<T> narrowK(final Higher<future, T> future) {
        return (Future<T>)future;
    }
413453
public static <E> Optional<E> maybeLast(Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call maybeLast with a null iterable");
        return new MaybeLastElement<E>().apply(iterable.iterator());
    }
1142761
public static function fromValue(
        $expected_type,
        $actual_value,
        DeserializationContext $context = null
    ) {
        if (null !== $context && count($context->getCurrentPath()) > 0) {
            $property = sprintf('property "%s" to be ', implode('.', $context->getCurrentPath()));
        } else {
            $property = '';
        }

        return new static(sprintf(
            'Expected %s%s, but got %s: %s',
            $property,
            $expected_type,
            gettype($actual_value),
            json_encode($actual_value)
        ));
    }
447777
public static <T> ApiFuture<T> toApiFuture(CompletableFuture<T> completableFuture) {
        return ApiFutureUtils.createApiFuture(Java8FutureUtils.createValueSourceFuture(completableFuture));
    }
238954
public static CompletableFuture<Void> from(ChannelFuture future) {

        LettuceAssert.notNull(future, "ChannelFuture must not be null");

        CompletableFuture<Void> result = new CompletableFuture<>();
        adapt(future, result);

        return result;
    }
1009525
public <R> Future<R> flatMapCf(final Function<? super T, ? extends CompletionStage<? extends R>> mapper) {
        return Future.<R> of(future.<R> thenCompose(t -> (CompletionStage<R>) mapper.apply(t)));
    }
1017723
public static Optional<SoyRuntimeType> getUnboxedType(SoyType soyType) {
    // Optional is immutable so Optional<Subclass> can always be safely cast to Optional<SuperClass>
    @SuppressWarnings({"unchecked", "rawtypes"})
    Optional<SoyRuntimeType> typed = (Optional) primitiveTypeCache.getUnchecked(soyType);
    return typed;
  }