Lazy evaluation.
@param supplier
@return
197250
public static CharStream of(final Supplier<CharList> supplier) {
        final CharIterator iter = new CharIteratorEx() {
            private CharIterator iterator = null;

            @Override
            public boolean hasNext() {
                if (iterator == null) {
                    init();
                }

                return iterator.hasNext();
            }

            @Override
            public char nextChar() {
                if (iterator == null) {
                    init();
                }

                return iterator.nextChar();
            }

            private void init() {
                final CharList c = supplier.get();

                if (N.isNullOrEmpty(c)) {
                    iterator = CharIterator.empty();
                } else {
                    iterator = c.iterator();
                }
            }
        };

        return of(iter);
    }
329980
public static <T> Supplier<T> supplier(CheckedSupplier<T> supplier) {
        return supplier(supplier, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
249428
private <R> R runInNewTx(final SQLSupplier<R> supplier) {
		try (LocalTransactionContext txContext = new LocalTransactionContext(this.connectionSupplier,
				this.sqlFilterManager)) {
			this.txCtxStack.push(txContext);
			try {
				return supplier.get();
			} catch (Exception ex) {
				txContext.setRollbackOnly();
				throw ex;
			} finally {
				try {
					txContext.close();
				} finally {
					this.txCtxStack.pop();
				}
			}
		}
	}
129955
public static <T> Position.Readable<T> readOnly(final Type type, final Supplier<T> supplier) {
        return new RO<>(Validate.notNull(type, "type"), Validate.notNull(supplier, "supplier"));
    }
142281
@Override
    public StreamT<W,T> onEmptyGet(final Supplier<? extends T> supplier) {

        return (StreamT<W,T>) FoldableTransformerSeq.super.onEmptyGet(supplier);
    }
496739
@NotNull
	public static Promise<Void> repeat(@NotNull Supplier<Promise<Void>> supplier) {
		return Promise.ofCallback(cb ->
				repeatImpl(supplier, cb));
	}
833336
public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) {
        return CompletableFuture
                .supplyAsync(handleSupplierWithException(supplier));
    }
158578
public static <T> Publisher<T> createMono( Supplier<CompletionStage<T>> supplier )
    {
        return Mono.create( sink -> supplier.get().whenComplete( ( item, completionError ) -> {
            Throwable error = Futures.completionExceptionCause( completionError );
            if ( item != null )
            {
                sink.success( item );
            }
            if ( error != null )
            {
                sink.error( error );
            }
            else
            {
                sink.success();
            }
        } ) );
    }
81228
public static <T, E extends Exception> T sneak(SneakySupplier<T, E> supplier) {
    return sneaked(supplier).get();
  }
1254520
public static <T> Supplier<Optional<T>> supplier(Iterator<T> adaptee) {
        return new IteratingSupplier<T>(adaptee);
    }
620946
public static <R> Supplier<R> monitor(Supplier<R> supplier, AtomicLong calls) {
        return new MonitoringSupplier<>(supplier, calls);
    }
551852
public static <T> ObjIterator<T> generate(final Supplier<T> supplier) {
        N.checkArgNotNull(supplier);

        return new ObjIterator<T>() {
            @Override
            public boolean hasNext() {
                return true;
            }

            @Override
            public T next() {
                return supplier.get();
            }
        };
    }
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;
            }
        };
    }
1163059
public FluentMatchingR<T, R> get(Supplier<R> supplier) {
    return get(fluentMatchingR, supplier);
  }
38489
public static IntIterator generate(final IntSupplier supplier) {
        N.checkArgNotNull(supplier);

        return new IntIterator() {
            @Override
            public boolean hasNext() {
                return true;
            }

            @Override
            public int nextInt() {
                return supplier.getAsInt();
            }
        };
    }
1221376
@Nonnull
	public static <T> SupplierBuilder<T> supplier(Consumer<Supplier<T>> consumer) {
		return new SupplierBuilder(consumer);
	}
387537
private <T> Optional<T> tryWithLock(Supplier<T> task)
    {
        return tryWithLock(0, TimeUnit.MILLISECONDS, task);
    }