package com.inspect.base.core.utils;

import java.util.function.BiConsumer;
import java.util.function.Consumer;

public class LambdaUtils {
    public static <T> Consumer<T> consumerWithIndex(BiConsumer<T, Integer> consumer) {
        class Obj {
            int index;
        }
        Obj obj = new Obj();
        return t -> {
            int index = obj.index++;
            consumer.accept(t, index);
        };
    }
}
