Note: Generally it's much slower than other {@code Collectors}.

@param maxWaitIntervalInMillis
@param supplier
@param streamingCollector
@return
@see Stream#observe(BlockingQueue, Predicate, long)
@see Stream#asyncCall(Try.Function)
423191
public static <T, R> Collector<T, ?, R> streaming(final long maxWaitIntervalInMillis, final Supplier<? extends BlockingQueue<T>> queueSupplier,
            final Function<? super Stream<T>, R> streamingCollector) {
        final Function<Stream<T>, ContinuableFuture<R>> streamingCollector2 = new Function<Stream<T>, ContinuableFuture<R>>() {
            @Override
            public ContinuableFuture<R> apply(Stream<T> t) {
                return t.asyncCall(streamingCollector);
            }
        };

        return streaming(queueSupplier, streamingCollector2, maxWaitIntervalInMillis);
    }
177984
public static <T> java.util.concurrent.ScheduledFuture<T> delay(final Supplier<T> function,
        final int delayMilliseconds) {
        final java.util.concurrent.ScheduledExecutorService scheduler =
            java.util.concurrent.Executors.newSingleThreadScheduledExecutor();
        final java.util.concurrent.ScheduledFuture<T> future = scheduler.schedule(
            new java.util.concurrent.Callable<T>() {
                public T call() {
                    return function.get();
                }
            }, delayMilliseconds, java.util.concurrent.TimeUnit.MILLISECONDS);
        scheduler.shutdown();
        return future;
    }
609613
@Override
  public StreamBuilderImpl<T,U> peek(ConsumerSync<? super T> consumer)
  {
    return new Peek<T,U>(this, consumer);
  }
329980
public static <T> Supplier<T> supplier(CheckedSupplier<T> supplier) {
        return supplier(supplier, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
983169
@SuppressWarnings("unchecked")
    public static <T> ReactiveSeq<T> takeUntil(final Stream<T> stream, final Predicate<? super T> predicate) {
        final Iterator<T> it = stream.iterator();

        class LimitUntil implements Iterator<T> {
            T next = (T) NULL;
            boolean test = false;

            void test() {
                if (!test && next == NULL && it.hasNext()) {
                    next = it.next();

                    if (test = predicate.test(next)) {
                        next = (T) NULL;
                        close(it); // need to close any open queues
                    }
                }
            }

            @Override
            public boolean hasNext() {
                test();
                return next != NULL;
            }

            @Override
            public T next() {
                if (next == NULL)
                    throw new NoSuchElementException();

                try {
                    return next;
                } finally {
                    next = (T) NULL;
                }
            }
        }

        return ReactiveSeq.fromIterator(new LimitUntil())
                  .onClose(() -> {
                      stream.close();
                  });
    }
891326
public static ExecutorService newMaxQueueThreadPool(int numWorkerThreads,
            long waitingMillis, int maxQueue) {
        return new ThreadPoolExecutor(numWorkerThreads, numWorkerThreads,
                0L, TimeUnit.MILLISECONDS,
                waitingMillis > 0 ? getWaitingLimitedBlockingQueue(
                        waitingMillis, maxQueue) : getLimitedBlockingQueue(
                        maxQueue));
    }
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();
				}
			}
		}
	}
1140394
public static <T extends Comparable<? super T>> Collector<T, ?, Optional<T>> max() {
        return maxBy(t -> t, naturalOrder());
    }
42328
public static boolean synchronousSync(CuratorFramework curator, Duration timeout) {
        try {
            // Curator sync() is always a background operation.  Use a latch to block until it finishes.
            final CountDownLatch latch = new CountDownLatch(1);
            curator.sync().inBackground(new BackgroundCallback() {
                @Override
                public void processResult(CuratorFramework curator, CuratorEvent event) throws Exception {
                    if (event.getType() == CuratorEventType.SYNC) {
                        latch.countDown();
                    }
                }
            }).forPath(curator.getNamespace().isEmpty() ? "/" : "");

            // Wait for sync to complete.
            return latch.await(timeout.toMillis(), TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            return false;
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
    }
740627
public static <T> Collector<T, ?, Seq<T>> maxAll(Comparator<? super T> comparator) {
        return maxAllBy(t -> t, comparator);
    }
202069
@Override
    public void registerAsynchConsumerCallback(
                                               AsynchConsumerCallback callback,
                                               int maxActiveMessages,
                                               long messageLockExpiry,
                                               int maxBatchSize,
                                               Reliability unrecoverableReliability,
                                               boolean inLine,
                                               OrderingContext context)
                    throws SISessionDroppedException, SISessionUnavailableException, SIErrorException, SIIncorrectCallException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConsumerSession.tc, "registerAsynchConsumerCallback",
                        new Object[] { this,
                                      callback,
                                      new Integer(maxActiveMessages),
                                      new Long(messageLockExpiry),
                                      new Integer(maxBatchSize),
                                      unrecoverableReliability,
                                      Boolean.valueOf(inLine),
                                      context });

        //register the AsynchConsumer with the LCP
        _localConsumerPoint.registerAsynchConsumer(
                                                   callback,
                                                   maxActiveMessages,
                                                   messageLockExpiry,
                                                   maxBatchSize,
                                                   unrecoverableReliability,
                                                   inLine,
                                                   (OrderingContextImpl) context,
                                                   null // No callback busy lock is used for non-mediation consumers.
        );

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConsumerSession.tc, "registerAsynchConsumerCallback");
    }
1154058
public static <T, Y extends Comparable<Y>> Collector<T, ?, Optional<T>> maxBy(Function<T, Y> projection) {
        return maxBy(projection, Comparable::compareTo);
    }
49638
public static <T, U> Collector<T, ?, Seq<T>> minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return maxAllBy(function, comparator.reversed());
    }
69704
@SuppressWarnings("unchecked")
   public static <T, R> Supplier<Collector<T, ?, R>> toSupplierCollect(Supplier supplier) {
      return supplier;
   }
1297592
public static <T> Supplier<T> synchronizedSupplier(Supplier<T> delegate) {
    return new ThreadSafeSupplier<T>(Preconditions.checkNotNull(delegate));
  }
1163059
public FluentMatchingR<T, R> get(Supplier<R> supplier) {
    return get(fluentMatchingR, supplier);
  }
1328008
public static <T> Collector<T, ?, Optional<T>> max(Comparator<? super T> comparator) {
        return maxBy(t -> t, comparator);
    }