If not null or empty consume.

@param <T>        the type parameter
@param <C>        the type parameter
@param collection the collection
@param consumer   the consumer
775888
public static <T, C extends Collection<T>> void
    ifNotNullOrEmptyConsume(C collection, Consumer<C> consumer) {
        JMOptional.getOptional(collection).ifPresent(consumer);
    }
1285233
public void set(int i, int j, T v)
    {
        consumer.set(i, j, v);
    }
472166
@SuppressWarnings( "unchecked" )
    public synchronized void addConsumer( MessageConsumer<? extends Serializable> consumer ) {
        consumers.add((MessageConsumer<Serializable>)consumer);
    }
257305
@Nonnull
	public static <T> LOiToDblFunctionBuilder<T> oiToDblFunction(Consumer<LOiToDblFunction<T>> consumer) {
		return new LOiToDblFunctionBuilder(consumer);
	}
743965
public static Function<Object, Collection<?>> COLLECTION(final Class<? extends Collection> collectionType) {
      return as(new CollectionConverterImpl<>(collectionType, null));
   }
844486
public void setConsumer(org.apache.kafka.clients.consumer.KafkaConsumer<Object, Object> consumer) {
        this.consumer = consumer;
    }
324294
public static <T> void forEach(Iterator<T> iterator, Consumer<T> consumer) {
		int index = 0;
		while (iterator.hasNext()) {
			consumer.accept(iterator.next(), index);
			index++;
		}
	}
90256
@Override
	public final void setConsumer(StreamConsumer<T> consumer) {
		checkNotNull(consumer);
		checkState(this.consumer == null, "Consumer has already been set");

		checkState(getCapabilities().contains(LATE_BINDING) || eventloop.tick() == createTick,
				LATE_BINDING_ERROR_MESSAGE, this);
		this.consumer = consumer;
		onWired();
		consumer.getAcknowledgement()
				.whenException(this::close)
				.whenComplete(acknowledgement);
	}
231575
protected void checkCollectionType(Collection c) {
        if (type != null) {
            for (Iterator iter = c.iterator(); iter.hasNext(); ) {
                Object element = iter.next();
                checkType(element);
            }
        }
    }
134728
public static void consumePathList(List<Path> pathList,
			Consumer<Path> consumer) {
		for (Path path : pathList)
			consumer.accept(path);
	}
378094
public static <E, T extends Collection<E>> void ifExist(T collection,
            Consumer<T> consumer) {
        getOptional(collection).ifPresent(consumer);
    }
421804
public Optional<T> ifPresent(final Consumer<? super T> consumer) {
        if (isPresent()) {
            consumer.accept(get());
        }

        return this;
    }
1248887
public <A> void match(Map<A,? extends Collection<I>> samples, BiConsumer<T, A> consumer)
    {
        Map<A,Collection<I>> m = new HashMap<>(samples);
        boolean cont = true;
        while (cont)
        {
            cont = false;
            Iterator<Entry<A, Collection<I>>> iterator = m.entrySet().iterator();
            while (iterator.hasNext())
            {
                Entry<A, Collection<I>> e = iterator.next();
                T match = match(e.getValue());
                if (match != null)
                {
                    consumer.accept(match, e.getKey());
                    cont = true;
                    iterator.remove();
                }
            }
        }
    }
310704
public void ifPresent(Consumer<? super T> consumer) {
        T value = get(false);

        if (value != null) {
            consumer.accept(value);
        }
    }
742986
@Override
    public LazyImmutable<T> peek(final Consumer<? super T> c) {

        return (LazyImmutable<T>) Transformable.super.peek(c);
    }
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);
    }
95303
public void forEach(final IntObjConsumer<String> consumer)
    {
        int counterId = 0;

        final AtomicBuffer metaDataBuffer = this.metaDataBuffer;
        for (int i = 0, capacity = metaDataBuffer.capacity(); i < capacity; i += METADATA_LENGTH)
        {
            final int recordStatus = metaDataBuffer.getIntVolatile(i);

            if (RECORD_ALLOCATED == recordStatus)
            {
                consumer.accept(counterId, labelValue(metaDataBuffer, i));
            }
            else if (RECORD_UNUSED == recordStatus)
            {
                break;
            }

            counterId++;
        }
    }