// Path: src/main/java/net/kimleo/rec/common/concept/Mapped.java
// public interface Mapped<T> {
//     T get(String field);
// 
//     List<String> keys();
// }
// 
// Path: src/main/java/net/kimleo/rec/sepval/parser/ParseConfig.java
// public class ParseConfig {
//     public final char delimiter;
//     public final char escape;
// 
//     public static final ParseConfig DEFAULT = new ParseConfig();
//     public static final ParseConfig BY_PIPE = new ParseConfig('|');
// 
//     public ParseConfig(char delimiter, char escape) {
//         this.delimiter = delimiter;
//         this.escape = escape;
//     }
// 
//     public ParseConfig(char delimiter) {
//         this(delimiter, '"');
//     }
// 
//     public ParseConfig() {
//         this(',', '"');
//     }
// }
// 
// Path: src/main/java/net/kimleo/rec/v2/model/Target.java
// public interface Target<T> {
//     void put(T record);
// 
//     default Target<T> tee(Tee<T> tee) {
//         return record -> this.put(tee.emit(record));
//     }
// 
//     default void putAll(Source<T> source) {
//         source.stream().forEach(this::put);
//     }
// 
// }


import net.kimleo.rec.common.concept.Mapped;
import net.kimleo.rec.sepval.parser.ParseConfig;
import net.kimleo.rec.v2.model.Target;
import org.junit.Test;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
package net.kimleo.rec.v2.model.impl;




public class CSVFileSourceTest {
    @Test
    public void shouldSuccessfullyParseAStream() throws Exception {
        URL resource = this.getClass().getClassLoader().getResource("CSVFileSource.csv");
        assert resource != null;
        File file = new File(resource.toURI());
        CSVFileSource source = new CSVFileSource(file, "id, name, dob, illegal", ParseConfig.DEFAULT);

        CollectTee<Mapped<String>> collector = new CollectTee<>(new ArrayList<>());
        HashSet<String> strings = new HashSet<>();

        ItemCounterTee<Mapped<String>> counter = new ItemCounterTee<>(it -> true);

// Path: src/main/java/net/kimleo/rec/common/concept/Mapped.java
// public interface Mapped<T> {
//     T get(String field);
// 
//     List<String> keys();
// }
// 
// Path: src/main/java/net/kimleo/rec/sepval/parser/ParseConfig.java
// public class ParseConfig {
//     public final char delimiter;
//     public final char escape;
// 
//     public static final ParseConfig DEFAULT = new ParseConfig();
//     public static final ParseConfig BY_PIPE = new ParseConfig('|');
// 
//     public ParseConfig(char delimiter, char escape) {
//         this.delimiter = delimiter;
//         this.escape = escape;
//     }
// 
//     public ParseConfig(char delimiter) {
//         this(delimiter, '"');
//     }
// 
//     public ParseConfig() {
//         this(',', '"');
//     }
// }
// 
// Path: src/main/java/net/kimleo/rec/v2/model/Target.java
// public interface Target<T> {
//     void put(T record);
// 
//     default Target<T> tee(Tee<T> tee) {
//         return record -> this.put(tee.emit(record));
//     }
// 
//     default void putAll(Source<T> source) {
//         source.stream().forEach(this::put);
//     }
// 
// }


// Path: src/test/java/net/kimleo/rec/v2/model/impl/CSVFileSourceTest.java
import net.kimleo.rec.common.concept.Mapped;
import net.kimleo.rec.sepval.parser.ParseConfig;
import net.kimleo.rec.v2.model.Target;
import org.junit.Test;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

package net.kimleo.rec.v2.model.impl;




public class CSVFileSourceTest {
    @Test
    public void shouldSuccessfullyParseAStream() throws Exception {
        URL resource = this.getClass().getClassLoader().getResource("CSVFileSource.csv");
        assert resource != null;
        File file = new File(resource.toURI());
        CSVFileSource source = new CSVFileSource(file, "id, name, dob, illegal", ParseConfig.DEFAULT);

        CollectTee<Mapped<String>> collector = new CollectTee<>(new ArrayList<>());
        HashSet<String> strings = new HashSet<>();

        ItemCounterTee<Mapped<String>> counter = new ItemCounterTee<>(it -> true);

        Target<Mapped<String>> target = record ->