Synchronized {@code Consumer}

@param mutex to synchronized on
@param consumer
@return
320817
@Beta
    public static <T> Consumer<T> sc(final Object mutex, final Consumer<T> consumer) {
        N.checkArgNotNull(mutex, "mutex");
        N.checkArgNotNull(consumer, "consumer");

        return new Consumer<T>() {
            @Override
            public void accept(T t) {
                synchronized (mutex) {
                    consumer.accept(t);
                }
            }
        };
    }
1174636
@Nonnull
	public static <T> LObjFltConsumerBuilder<T> objFltConsumer(Consumer<LObjFltConsumer<T>> consumer) {
		return new LObjFltConsumerBuilder(consumer);
	}
1031094
public void ifHasValue(Consumer<? super V> consumer) {

        LettuceAssert.notNull(consumer, "Consumer must not be null");

        if (hasValue()) {
            consumer.accept(getValue());
        }
    }
333278
@Nonnull
	public static <T> LObjIntConsumerBuilder<T> objIntConsumer(Consumer<LObjIntConsumer<T>> consumer) {
		return new LObjIntConsumerBuilder(consumer);
	}
134357
@Nonnull
	public static <T, R> LObjCharFunctionBuilder<T, R> objCharFunction(Consumer<LObjCharFunction<T, R>> consumer) {
		return new LObjCharFunctionBuilder(consumer);
	}
133871
public static <T> ObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> consumer) {
        return objLongConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
162078
@Nonnull
	public static <T, R> LObjIntDblFunctionBuilder<T, R> objIntDblFunction(Consumer<LObjIntDblFunction<T, R>> consumer) {
		return new LObjIntDblFunctionBuilder(consumer);
	}
1354815
public static <T, U, E extends Throwable> @NonNull BiConsumer<T, U> rethrowBiConsumer(final @NonNull ThrowingBiConsumer<T, U, E> consumer) {
    return consumer;
  }
1085741
@Nonnull
	public static <T> LOiToSrtFunctionBuilder<T> oiToSrtFunction(Consumer<LOiToSrtFunction<T>> consumer) {
		return new LOiToSrtFunctionBuilder(consumer);
	}
373197
@Nonnull
	public static <T> LPredicateBuilder<T> predicate(Consumer<LPredicate<T>> consumer) {
		return new LPredicateBuilder(consumer);
	}
147178
@Nonnull
	public static <T> LObjDblPredicateBuilder<T> objDblPredicate(Consumer<LObjDblPredicate<T>> consumer) {
		return new LObjDblPredicateBuilder(consumer);
	}
570805
public static <T> Runnable curry(Consumer<T> consumer, T value) {
        dbc.precondition(consumer != null, "cannot bind parameter of a null consumer");
        return () -> consumer.accept(value);
    }
371621
@Nonnull
	public static <T> ObjIntConsumerBuilder<T> objIntConsumer(Consumer<ObjIntConsumer<T>> consumer) {
		return new ObjIntConsumerBuilder(consumer);
	}
202361
public FluentMatchingC<T> then(Consumer3<A, B, C> consumer) {
    return then(fluentMatchingC, consumer);
  }
360814
public static <T> Consumer<T> monitor(Consumer<T> consumer, AtomicLong calls) {
        return new MonitoringConsumer<T>(consumer, calls);
    }
1182814
public static <T> Function<T, Void> voidFunction(Consumer<T> consumer) {
        return v -> {
            consumer.accept(v);
            return null;
        };
    }
324294
public static <T> void forEach(Iterator<T> iterator, Consumer<T> consumer) {
		int index = 0;
		while (iterator.hasNext()) {
			consumer.accept(iterator.next(), index);
			index++;
		}
	}