// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> L<T> L(Stream<T> stream) {
//     return new L(stream.collect(Collectors.toList()));
// }
// 
// 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/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 List<List<Integer>> EXPECTED_NESTED_LIST = new ArrayList<>();
// 
// 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/I.java
// public interface I<K, V> {
//     // We have to allow derived return values because we need that in V2
//     /**
//      * Invokes Map#get(Object) or invokes the function set by {@link #WithDefault(Function)} with the <code>key</code> provided,
//      * if it would return <code>null</code> or the key is invalid.
//      */
//     public <VN extends V> VN get(K key);
//     
//     /**
//      * @see #get(Object)
//      */
//     public default List<V> get(K... keys) {
//         return C.toStream(keys).map(it -> this.<V> get(it)).collect(Collectors.toList());
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default List<V> getAll(Collection<K>... keys) {
//         return C.toStream(keys).map(c -> C.toStream(c).map(it -> this.<V> get(it)).collect(Collectors.toList()))
//                 .flatMap(Collection::stream).collect(Collectors.toList());
//     }
//     
//     // We have to allow derived return values because we need that in V2
//     /**
//      * @see Map#getOrDefault(Object, Object)
//      */
//     public <VN extends V> VN getOrDefault(K key, VN defaultValue);
//     
//     /**
//      * Sets the function for creating a default value as an alternative to an otherwise unsuccessful {@link #get(Object)} invocation.
//      * 
//      * @param defaultValue the new default value
//      * @return <code>this (modified)</code>
//      */
//     public ReadonlyIndexedI<K, V> WithDefault(Function<K, V> defaultValue);
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> g(K... keys) {
//         return Get(keys);
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default V g(K key) {
//         return get(key);
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> Get(K... keys) {
//         return L(get(keys));
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> GetAll(Collection<K>... keys) {
//         return L(getAll(keys));
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> G(Collection<K>... keys) {
//         return L(getAll(keys));
//     }
// }


import static ch.codebulb.lambdaomega.L.L;
import static ch.codebulb.lambdaomega.L.l;
import static ch.codebulb.lambdaomega.L.list;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_LIST;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_NESTED_LIST;
import static ch.codebulb.lambdaomega.TestUtil.assertEquals;
import ch.codebulb.lambdaomega.abstractions.I;
import java.util.ArrayList;
import java.util.List;
import org.junit.AfterClass;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.BeforeClass;
import org.junit.Test;
package ch.codebulb.lambdaomega;


/**
 * Basic test cases for {@link L}.
 */
public class LBaseTest {
    @BeforeClass
    public static void beforeClass() {
        L.TEST_DISABLE_HELPER_MAP_CONVERSION = true;
    }
    
    @Test
    public void testObject() {
        assertTrue(l().equals(l()));
        assertTrue(l(0, 1, 2).equals(l(0, 1, 2)));
        assertFalse(l(9, 1, 2).equals(l(0, 1, 2)));
        assertTrue(list(0, 1, 2).equals(l(0, 1, 2).l));
        
        assertEquals("L[0, 1, 2]", "L" + EXPECTED_LIST.toString(), l(0, 1, 2).toString());
    }
    
    @Test
    public void testStream() {
        assertFalse(l().stream().isParallel());
        assertFalse(l().Seq().stream().isParallel());
        assertTrue(l().Par().stream().isParallel());
    }
        
    @Test
    public void testWithDefault() {
// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> L<T> L(Stream<T> stream) {
//     return new L(stream.collect(Collectors.toList()));
// }
// 
// 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/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 List<List<Integer>> EXPECTED_NESTED_LIST = new ArrayList<>();
// 
// 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/I.java
// public interface I<K, V> {
//     // We have to allow derived return values because we need that in V2
//     /**
//      * Invokes Map#get(Object) or invokes the function set by {@link #WithDefault(Function)} with the <code>key</code> provided,
//      * if it would return <code>null</code> or the key is invalid.
//      */
//     public <VN extends V> VN get(K key);
//     
//     /**
//      * @see #get(Object)
//      */
//     public default List<V> get(K... keys) {
//         return C.toStream(keys).map(it -> this.<V> get(it)).collect(Collectors.toList());
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default List<V> getAll(Collection<K>... keys) {
//         return C.toStream(keys).map(c -> C.toStream(c).map(it -> this.<V> get(it)).collect(Collectors.toList()))
//                 .flatMap(Collection::stream).collect(Collectors.toList());
//     }
//     
//     // We have to allow derived return values because we need that in V2
//     /**
//      * @see Map#getOrDefault(Object, Object)
//      */
//     public <VN extends V> VN getOrDefault(K key, VN defaultValue);
//     
//     /**
//      * Sets the function for creating a default value as an alternative to an otherwise unsuccessful {@link #get(Object)} invocation.
//      * 
//      * @param defaultValue the new default value
//      * @return <code>this (modified)</code>
//      */
//     public ReadonlyIndexedI<K, V> WithDefault(Function<K, V> defaultValue);
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> g(K... keys) {
//         return Get(keys);
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default V g(K key) {
//         return get(key);
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> Get(K... keys) {
//         return L(get(keys));
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> GetAll(Collection<K>... keys) {
//         return L(getAll(keys));
//     }
//     
//     /**
//      * @see #get(Object)
//      */
//     public default L<V> G(Collection<K>... keys) {
//         return L(getAll(keys));
//     }
// }


// Path: src/test/java/ch/codebulb/lambdaomega/LBaseTest.java
import static ch.codebulb.lambdaomega.L.L;
import static ch.codebulb.lambdaomega.L.l;
import static ch.codebulb.lambdaomega.L.list;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_LIST;
import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_NESTED_LIST;
import static ch.codebulb.lambdaomega.TestUtil.assertEquals;
import ch.codebulb.lambdaomega.abstractions.I;
import java.util.ArrayList;
import java.util.List;
import org.junit.AfterClass;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.BeforeClass;
import org.junit.Test;

package ch.codebulb.lambdaomega;


/**
 * Basic test cases for {@link L}.
 */
public class LBaseTest {
    @BeforeClass
    public static void beforeClass() {
        L.TEST_DISABLE_HELPER_MAP_CONVERSION = true;
    }
    
    @Test
    public void testObject() {
        assertTrue(l().equals(l()));
        assertTrue(l(0, 1, 2).equals(l(0, 1, 2)));
        assertFalse(l(9, 1, 2).equals(l(0, 1, 2)));
        assertTrue(list(0, 1, 2).equals(l(0, 1, 2).l));
        
        assertEquals("L[0, 1, 2]", "L" + EXPECTED_LIST.toString(), l(0, 1, 2).toString());
    }
    
    @Test
    public void testStream() {
        assertFalse(l().stream().isParallel());
        assertFalse(l().Seq().stream().isParallel());
        assertTrue(l().Par().stream().isParallel());
    }
        
    @Test
    public void testWithDefault() {
        I<Integer, List<Integer>> listWithDefault = l(list(5), list(6), list(7)).WithDefault(it -> list(it * 2));