// Path: src/main/java/org/dataloader/DataLoaderFactory.java
// public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadFunction) {
//     return newDataLoader(batchLoadFunction, null);
// }


import org.junit.Test;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import static org.dataloader.DataLoaderFactory.newDataLoader;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.sameInstance;
import static org.junit.Assert.assertThat;
package org.dataloader;





/**
 * Tests for IfPresent and IfCompleted functionality.
 */
public class DataLoaderIfPresentTest {

    private <T> BatchLoader<T, T> keysAsValues() {
        return CompletableFuture::completedFuture;
    }

    @Test
    public void should_detect_if_present_cf() {
// Path: src/main/java/org/dataloader/DataLoaderFactory.java
// public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadFunction) {
//     return newDataLoader(batchLoadFunction, null);
// }


// Path: src/test/java/org/dataloader/DataLoaderIfPresentTest.java
import org.junit.Test;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import static org.dataloader.DataLoaderFactory.newDataLoader;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.sameInstance;
import static org.junit.Assert.assertThat;

package org.dataloader;





/**
 * Tests for IfPresent and IfCompleted functionality.
 */
public class DataLoaderIfPresentTest {

    private <T> BatchLoader<T, T> keysAsValues() {
        return CompletableFuture::completedFuture;
    }

    @Test
    public void should_detect_if_present_cf() {
        DataLoader<Integer, Integer> dataLoader = newDataLoader(keysAsValues());