/commons-utils

Hello the fucking world!

Primary LanguageJavaApache License 2.0Apache-2.0

commons

Hello the fucking world!

public class Iterables {

public static <E> void forEach(
        Iterable<? extends E> elements, BiConsumer<Integer, ? super E> action) {
    Objects.requireNonNull(elements);
    Objects.requireNonNull(action);

    int index = 0;
    for (E element : elements) {
        action.accept(index++, element);
    }
}

}