package com.platform.modules.live.utils;/**
 * Created by TROY on 2019/2/16.
 */

import java.util.Objects;
import java.util.function.BiConsumer;

/**
 * @author TROY
 * @version V1.0
 * @ClassName: ArraysCustomeUtils
 * @Description: TODO
 * @date 2019/2/16 20:10
 */
public class ArraysCustomeUtils {
	public static <E> void forEach(
			E[] elements, BiConsumer<Integer, ? super E> action) {
		Objects.requireNonNull(elements);
		Objects.requireNonNull(action);

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