// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> L<T> l() {
//     return new L<>(new ArrayList<>());
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> List<T> list(T... ts) {
//     return l(ts).l;
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/M.java
// public static <K, V> E<K, V> e(K k, V v) {
//     return new E(k, v);
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/M.java
// public static M m() {
//     return m(new LinkedHashMap<>());
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/S.java
// public static <T> Set<T> set(T... ts) {
//     return C.toSet(ts);
// }
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static final List<Integer> EXPECTED_LIST = new ArrayList<>();
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static final Map<String, Integer> EXPECTED_MAP = new LinkedHashMap<>();
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static final Map<String, Integer> EXPECTED_MAP_2_ELEMENTS = new LinkedHashMap<>();
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static <T> void assertEquals(T expected, T... actual) {
//     Arrays.stream(actual).forEach(it -> Assert.assertEquals(expected, it));
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/abstractions/IndexedListI.java
// public static class IndexAlreadyPresentException extends RuntimeException {
//     // cannot use generics in Throwable
//     public final Object key;
//     public final Object previousValue;
// 
//     public IndexAlreadyPresentException(Object key, Object previousValue) {
//         super("Duplicate key found in map. Use #set(...) to override a value. Key: " + key + ", previous value: " + previousValue);
//         this.key = key;
//         this.previousValue = previousValue;
//     }
// }


import static ch.codebulb.lambdaomega.L.l;
import static ch.codebulb.lambdaomega.L.list;
import static ch.codebulb.lambdaomega.M.e;
import static ch.codebulb.lambdaomega.M.m;
import static ch.codebulb.lambdaomega.S.set;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_LIST;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_MAP;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_MAP_2_ELEMENTS;
import static ch.codebulb.lambdaomega.TestUtil.assertEquals;
import ch.codebulb.lambdaomega.abstractions.IndexedListI.IndexAlreadyPresentException;
import java.util.Map;
import static org.junit.Assert.fail;
import org.junit.Test;
        assertEquals(EXPECTED_MAP, replaceMapExpected, replaceMap.m);
    }
    
    @Test
    public void testRemove() {
        // Remove individual entries at index
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).DeleteKey("d", "e").m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).d("d", "e").m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).deleteKey("d", "e"));
        
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).DeleteValue(3, 4).m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).deleteValue(3, 4));
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 3).i("a", 0).i("b", 1).i("c", 2).deleteValue(3, 3));
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).deleteValue(3, 4, -1));
        
        // Conditional remove
        M<String, Number> removeMap = m(String.class, Number.class).i("d", 3).i("a", 0).i("b", 1).i("c", 2);
        Map<String, Number> removeMapExpected = m(String.class, Number.class).i("d", 3).i("a", 0).i("b", 1).i("c", 2).m;
        assertEquals(true, removeMap.deleteIfMatches("d", 3));
        assertEquals(true, removeMapExpected.remove("d", 3));
        assertEquals(EXPECTED_MAP, removeMap.m);
        assertEquals(false, removeMap.deleteIfMatches("a", 4));
        assertEquals(false, removeMapExpected.remove("a", 4));
        assertEquals(EXPECTED_MAP, removeMapExpected);
        
        // Remove all entries
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("f", 5).i("a", 0).i("b", 1).i("c", 2).DeleteAllKeys(list("d"), list("e", "f")).m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("f", 5).i("a", 0).i("b", 1).i("c", 2).D(list("d"), list("e", "f")).m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("f", 5).i("a", 0).i("b", 1).i("c", 2).deleteAllKeys(list("d"), list("e", "f")));
        
// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> L<T> l() {
//     return new L<>(new ArrayList<>());
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> List<T> list(T... ts) {
//     return l(ts).l;
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/M.java
// public static <K, V> E<K, V> e(K k, V v) {
//     return new E(k, v);
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/M.java
// public static M m() {
//     return m(new LinkedHashMap<>());
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/S.java
// public static <T> Set<T> set(T... ts) {
//     return C.toSet(ts);
// }
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static final List<Integer> EXPECTED_LIST = new ArrayList<>();
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static final Map<String, Integer> EXPECTED_MAP = new LinkedHashMap<>();
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static final Map<String, Integer> EXPECTED_MAP_2_ELEMENTS = new LinkedHashMap<>();
// 
// Path: src/test/java/ch/codebulb/lambdaomega/TestUtil.java
// public static <T> void assertEquals(T expected, T... actual) {
//     Arrays.stream(actual).forEach(it -> Assert.assertEquals(expected, it));
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/abstractions/IndexedListI.java
// public static class IndexAlreadyPresentException extends RuntimeException {
//     // cannot use generics in Throwable
//     public final Object key;
//     public final Object previousValue;
// 
//     public IndexAlreadyPresentException(Object key, Object previousValue) {
//         super("Duplicate key found in map. Use #set(...) to override a value. Key: " + key + ", previous value: " + previousValue);
//         this.key = key;
//         this.previousValue = previousValue;
//     }
// }


// Path: src/test/java/ch/codebulb/lambdaomega/MBaseIndexedTest.java
import static ch.codebulb.lambdaomega.L.l;
import static ch.codebulb.lambdaomega.L.list;
import static ch.codebulb.lambdaomega.M.e;
import static ch.codebulb.lambdaomega.M.m;
import static ch.codebulb.lambdaomega.S.set;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_LIST;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_MAP;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_MAP_2_ELEMENTS;
import static ch.codebulb.lambdaomega.TestUtil.assertEquals;
import ch.codebulb.lambdaomega.abstractions.IndexedListI.IndexAlreadyPresentException;
import java.util.Map;
import static org.junit.Assert.fail;
import org.junit.Test;

        assertEquals(EXPECTED_MAP, replaceMapExpected, replaceMap.m);
    }
    
    @Test
    public void testRemove() {
        // Remove individual entries at index
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).DeleteKey("d", "e").m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).d("d", "e").m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).deleteKey("d", "e"));
        
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).DeleteValue(3, 4).m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).deleteValue(3, 4));
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 3).i("a", 0).i("b", 1).i("c", 2).deleteValue(3, 3));
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("a", 0).i("b", 1).i("c", 2).deleteValue(3, 4, -1));
        
        // Conditional remove
        M<String, Number> removeMap = m(String.class, Number.class).i("d", 3).i("a", 0).i("b", 1).i("c", 2);
        Map<String, Number> removeMapExpected = m(String.class, Number.class).i("d", 3).i("a", 0).i("b", 1).i("c", 2).m;
        assertEquals(true, removeMap.deleteIfMatches("d", 3));
        assertEquals(true, removeMapExpected.remove("d", 3));
        assertEquals(EXPECTED_MAP, removeMap.m);
        assertEquals(false, removeMap.deleteIfMatches("a", 4));
        assertEquals(false, removeMapExpected.remove("a", 4));
        assertEquals(EXPECTED_MAP, removeMapExpected);
        
        // Remove all entries
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("f", 5).i("a", 0).i("b", 1).i("c", 2).DeleteAllKeys(list("d"), list("e", "f")).m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("f", 5).i("a", 0).i("b", 1).i("c", 2).D(list("d"), list("e", "f")).m);
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("f", 5).i("a", 0).i("b", 1).i("c", 2).deleteAllKeys(list("d"), list("e", "f")));
        
        assertEquals(EXPECTED_MAP, m("d", 3).i("e", 4).i("f", 5).i("a", 0).i("b", 1).i("c", 2).DeleteAllKeys(l("d"), l("e", "f")).m);