// 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 Map<String, Integer> EXPECTED_MAP = 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));
// }


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_MAP;
import static ch.codebulb.lambdaomega.TestUtil.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
package ch.codebulb.lambdaomega;


/**
 * Test cases for the {@link M} implementation for {@link SequentialI}.
 */
public class MBaseSequentialTest {
    @Test
    public void testConvert() {
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m("a", 0).i("b", 1).i("c", 2).toSet());
        
        assertEquals(m("a", 0).i("b", 1).i("c", 2).m, m("a", 0).i("b", 1).i("c", 2).toMap());
    }
    
    @Test
    public void testCollection() {
        assertEquals(0, m().size());
        assertEquals(3, m("a", 0).i("b", 1).i("c", 2).size());
        
        assertTrue(m().isEmpty());
        assertFalse(m("a", 0).i("b", 1).i("c", 2).isEmpty());
        
        assertEquals(set(), m("a", 0).i("b", 1).i("c", 2).clear());
    }
    
    @Test
    public void testAdd() {
        // Add individual elements
        assertEquals(EXPECTED_MAP, m("a", 0).i("b", 1).Add(e("c", 2)).m);
        assertEquals(EXPECTED_MAP, m("a", 0).i("b", 1).a(e("c", 2)).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m("a", 0).i("b", 1).add(e("c", 2)));
        
        assertEquals(EXPECTED_MAP, m(Number.class).Add(e("a", 0), e("b", 1), e("c", 2)).m);
        assertEquals(EXPECTED_MAP, m(Number.class).a(e("a", 0), e("b", 1), e("c", 2)).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m(Number.class).add(e("a", 0), e("b", 1), e("c", 2)));
        
        // Add all entries
        assertEquals(EXPECTED_MAP, m(Number.class).AddAll(list(e("a", 0), e("b", 1), e("c", 2))).m);
        assertEquals(EXPECTED_MAP, m(Number.class).A(list(e("a", 0), e("b", 1), e("c", 2))).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m(Number.class).addAll(list(e("a", 0), e("b", 1), e("c", 2))));
        
        assertEquals(EXPECTED_MAP, m(Number.class).AddAll(list(e("a", 0), e("b", 1)), list(e("c", 2))).m);
        assertEquals(EXPECTED_MAP, m(Number.class).A(list(e("a", 0), e("b", 1)), list(e("c", 2))).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m(Number.class).addAll(list(e("a", 0), e("b", 1)), list(e("c", 2))));
        
        // Add all L entries
// 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 Map<String, Integer> EXPECTED_MAP = 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/test/java/ch/codebulb/lambdaomega/MBaseSequentialTest.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_MAP;
import static ch.codebulb.lambdaomega.TestUtil.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

package ch.codebulb.lambdaomega;


/**
 * Test cases for the {@link M} implementation for {@link SequentialI}.
 */
public class MBaseSequentialTest {
    @Test
    public void testConvert() {
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m("a", 0).i("b", 1).i("c", 2).toSet());
        
        assertEquals(m("a", 0).i("b", 1).i("c", 2).m, m("a", 0).i("b", 1).i("c", 2).toMap());
    }
    
    @Test
    public void testCollection() {
        assertEquals(0, m().size());
        assertEquals(3, m("a", 0).i("b", 1).i("c", 2).size());
        
        assertTrue(m().isEmpty());
        assertFalse(m("a", 0).i("b", 1).i("c", 2).isEmpty());
        
        assertEquals(set(), m("a", 0).i("b", 1).i("c", 2).clear());
    }
    
    @Test
    public void testAdd() {
        // Add individual elements
        assertEquals(EXPECTED_MAP, m("a", 0).i("b", 1).Add(e("c", 2)).m);
        assertEquals(EXPECTED_MAP, m("a", 0).i("b", 1).a(e("c", 2)).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m("a", 0).i("b", 1).add(e("c", 2)));
        
        assertEquals(EXPECTED_MAP, m(Number.class).Add(e("a", 0), e("b", 1), e("c", 2)).m);
        assertEquals(EXPECTED_MAP, m(Number.class).a(e("a", 0), e("b", 1), e("c", 2)).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m(Number.class).add(e("a", 0), e("b", 1), e("c", 2)));
        
        // Add all entries
        assertEquals(EXPECTED_MAP, m(Number.class).AddAll(list(e("a", 0), e("b", 1), e("c", 2))).m);
        assertEquals(EXPECTED_MAP, m(Number.class).A(list(e("a", 0), e("b", 1), e("c", 2))).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m(Number.class).addAll(list(e("a", 0), e("b", 1), e("c", 2))));
        
        assertEquals(EXPECTED_MAP, m(Number.class).AddAll(list(e("a", 0), e("b", 1)), list(e("c", 2))).m);
        assertEquals(EXPECTED_MAP, m(Number.class).A(list(e("a", 0), e("b", 1)), list(e("c", 2))).m);
        assertEquals(set(e("a", 0), e("b", 1), e("c", 2)), m(Number.class).addAll(list(e("a", 0), e("b", 1)), list(e("c", 2))));
        
        // Add all L entries
        assertEquals(EXPECTED_MAP, m(Number.class).AddAll(l(e("a", 0), e("b", 1), e("c", 2))).m);