// Path: src/main/java/org/dataloader/impl/Assertions.java
// @Internal
// public class Assertions {
// 
//     public static void assertState(boolean state, Supplier<String> message) {
//         if (!state) {
//             throw new DataLoaderAssertionException(message.get());
//         }
//     }
// 
//     public static <T> T nonNull(T t) {
//         return nonNull(t, () -> "nonNull object required");
//     }
// 
//     public static <T> T nonNull(T t, Supplier<String> message) {
//         if (t == null) {
//             throw new NullPointerException(message.get());
//         }
//         return t;
//     }
// 
// }


import org.dataloader.annotations.PublicApi;
import org.dataloader.impl.Assertions;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
    /**
     * Each call to {@link org.dataloader.DataLoader#load(Object, Object)} or
     * {@link org.dataloader.DataLoader#loadMany(java.util.List, java.util.List)} can be given
     * a context object when it is invoked.  A list of them is present by this method.
     *
     * @return a list of key context objects in the order they where encountered
     */
    public List<Object> getKeyContextsList() {
        return keyContextsList;
    }

    public static Builder newBatchLoaderEnvironment() {
        return new Builder();
    }

    public static class Builder {
        private Object context;
        private Map<Object, Object> keyContexts = Collections.emptyMap();
        private List<Object> keyContextsList = Collections.emptyList();

        private Builder() {

        }

        public Builder context(Object context) {
            this.context = context;
            return this;
        }

        public <K> Builder keyContexts(List<K> keys, List<Object> keyContexts) {
// Path: src/main/java/org/dataloader/impl/Assertions.java
// @Internal
// public class Assertions {
// 
//     public static void assertState(boolean state, Supplier<String> message) {
//         if (!state) {
//             throw new DataLoaderAssertionException(message.get());
//         }
//     }
// 
//     public static <T> T nonNull(T t) {
//         return nonNull(t, () -> "nonNull object required");
//     }
// 
//     public static <T> T nonNull(T t, Supplier<String> message) {
//         if (t == null) {
//             throw new NullPointerException(message.get());
//         }
//         return t;
//     }
// 
// }


// Path: src/main/java/org/dataloader/BatchLoaderEnvironment.java
import org.dataloader.annotations.PublicApi;
import org.dataloader.impl.Assertions;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

    /**
     * Each call to {@link org.dataloader.DataLoader#load(Object, Object)} or
     * {@link org.dataloader.DataLoader#loadMany(java.util.List, java.util.List)} can be given
     * a context object when it is invoked.  A list of them is present by this method.
     *
     * @return a list of key context objects in the order they where encountered
     */
    public List<Object> getKeyContextsList() {
        return keyContextsList;
    }

    public static Builder newBatchLoaderEnvironment() {
        return new Builder();
    }

    public static class Builder {
        private Object context;
        private Map<Object, Object> keyContexts = Collections.emptyMap();
        private List<Object> keyContextsList = Collections.emptyList();

        private Builder() {

        }

        public Builder context(Object context) {
            this.context = context;
            return this;
        }

        public <K> Builder keyContexts(List<K> keys, List<Object> keyContexts) {
            Assertions.nonNull(keys);