Supplies what was given. Useful for adapting to methods that require a supplier.

@param toSupply the item to supply
187724
public static <T> Supplier<T> identitySupplier(final T toSupply) {
    return new Supplier<T>() {
      @Override
      public T get(VisitorState state) {
        return toSupply;
      }
    };
  }
1354774
public static <T, V> ChannelSupplier<V> remap(ChannelSupplier<T> supplier, Function<? super T, ? extends Iterator<? extends V>> fn) {
		return new AbstractChannelSupplier<V>(supplier) {
			Iterator<? extends V> iterator = CollectionUtils.emptyIterator();
			boolean endOfStream;

			@Override
			protected Promise<V> doGet() {
				if (iterator.hasNext()) return Promise.of(iterator.next());
				return Promise.ofCallback(this::next);
			}

			private void next(SettableCallback<V> cb) {
				if (!endOfStream) {
					supplier.get()
							.whenComplete((item, e) -> {
								if (e == null) {
									if (item == null) endOfStream = true;
									iterator = fn.apply(item);
									if (iterator.hasNext()) {
										cb.set(iterator.next());
									} else {
										next(cb);
									}
								} else {
									cb.setException(e);
								}
							});
				} else {
					cb.set(null);
				}
			}
		};
	}
350006
protected Supplier<ExecutionResult> supply(Supplier<ExecutionResult> supplier) {
    return () -> {
      ExecutionResult result = preExecute();
      if (result != null)
        return result;

      return postExecute(supplier.get());
    };
  }
329980
public static <T> Supplier<T> supplier(CheckedSupplier<T> supplier) {
        return supplier(supplier, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
778173
private boolean containerOfSubtyping(
      Set<String> containerTypeParameters,
      AnnotationInfo annotation,
      TypeVariableSymbol typaram,
      Type tyargument) {
    // (1)
    if (!tyargument.hasTag(TypeTag.TYPEVAR)) {
      return false;
    }
    // (2)
    if (!containerTypeParameters.contains(tyargument.asElement().getSimpleName().toString())
        || isTypeParameterThreadSafe(
            (TypeVariableSymbol) tyargument.asElement(), containerTypeParameters)) {
      return false;
    }
    // (3)
    if (annotation.containerOf().contains(typaram.getSimpleName().toString())) {
      return false;
    }
    return true;
  }
259751
function(args, connectionInfo) {
  // args.consignmentIdToProductIdMap.value MUST already be set by the caller
  // args.consignmentProductId.value MUST be set for the very first call
  args.arrayIndex = {value: 0};
  args.consignmentProductId = {value: args.consignmentIdToProductIdMap.value[args.arrayIndex.value].productId};
  args.getArray = function(){
    return this.consignmentIdToProductIdMap.value;
  };
  args.getArrayIndex = function(){
    return this.arrayIndex.value;
  };

  // iterate serially through a promise chain for all args.consignmentIds.value
  return utils.processPromisesSerially(
    args.getArray(),
    args.getArrayIndex(),
    args,
    function mergeStrategy(newData, previousData, args){
      log.debug('resolveMissingSuppliers - inside mergeStrategy()');
      var product = newData.products[0];
      //log.silly('newData: ', newData);
      //log.silly('product: ', product);
      var updateMe = args.getArray()[args.getArrayIndex()];
      updateMe.supplier = product.supplier_name || product.supplier_code;
      log.debug('updated consignmentIdToProductIdMap: ', args.getArray()[args.getArrayIndex()]);

      previousData = args.getArray();
      return Promise.resolve(previousData); // why do we need a promise?
    },
    function setupNext(updateArgs){
      log.debug('resolveMissingSuppliers - inside setupNext()');
      updateArgs.arrayIndex.value = updateArgs.getArrayIndex() + 1;
      if (updateArgs.getArrayIndex() < updateArgs.getArray().length) {
        updateArgs.consignmentProductId.value = updateArgs.getArray()[updateArgs.getArrayIndex()].productId;
        log.debug('resolveMissingSuppliers - next is consignmentId: ' + updateArgs.consignmentProductId.value);
      }
      else {
        updateArgs.consignmentProductId.value = null;
        log.debug('resolveMissingSuppliers - finished iterating through all the consignmentIds');
      }
      return updateArgs;
    },
    function executeNext(updatedArgs){
      log.debug('resolveMissingSuppliers - inside executeNext()');
      log.debug('resolveMissingSuppliers - executing for consignmentProductId: ' + updatedArgs.consignmentProductId.value);
      //log.silly('updatedArgs: ', updatedArgs);
      var args = argsForInput.products.fetchById();
      args.apiId.value = updatedArgs.consignmentProductId.value;
      return product.endpoints.fetchProduct(args, connectionInfo);
    }
  );
}
642007
public SoyTofu compileToTofu(Map<String, Supplier<Object>> pluginInstances) {
    resetErrorReporter();
    ServerCompilationPrimitives primitives = compileForServerRendering();
    throwIfErrorsPresent();
    SoyTofu tofu = doCompileToTofu(primitives, pluginInstances);

    reportWarnings();
    return tofu;
  }
820739
public static <T> T orElseGetIfNull(T target, Supplier<T> elseGetSupplier) {
        return Optional.ofNullable(target).orElseGet(elseGetSupplier);
    }
1098171
@Override
	public <R> R requiresNew(final SQLSupplier<R> supplier) {
		return transactionManager.requiresNew(supplier);
	}
477813
public void setDeliveryForecastSource(com.google.api.ads.admanager.axis.v201902.DeliveryForecastSource deliveryForecastSource) {
        this.deliveryForecastSource = deliveryForecastSource;
    }
795485
public static <T> Supplier<T> once(final Supplier<T> function) {
        return new Supplier<T>() {
            private volatile boolean executed;
            private T result;
            @Override
            public T get() {
                if (!executed) {
                    executed = true;
                    result = function.get();
                }
                return result;
            }
        };
    }
940679
public static <R> R supplierIfNull(R target, Supplier<R> supplier) {
        return Optional.ofNullable(target).orElseGet(supplier);
    }
642855
public final A orElseGet(Supplier<A> otherSupplier) {
        return match(__ -> otherSupplier.get(), id());
    }
732325
public static Supplier<Boolean> supplier(BooleanSupplier adaptee) {
        dbc.precondition(adaptee != null, "cannot adapt a null boolean supplier");
        return () -> adaptee.getAsBoolean();
    }
209436
@SuppressWarnings("unchecked")
	@Override
	public T param(final String paramName, final Supplier<Object> supplier) {
		context().param(paramName, supplier);
		return (T) this;
	}
1109459
@Nonnull
	public static <T> Supplier<T> supplierFrom(Consumer<SupplierBuilder<T>> buildingFunction) {
		SupplierBuilder builder = new SupplierBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
126052
public static <T, E extends Exception> Supplier<T> rethrowSupplier(SupplierWithExceptions<T, E> function) throws E {
        return () -> {
            try {
                return function.get();
            } catch (Exception exception) {
                throwAsUnchecked(exception);
                return null;
            }
        };
    }