package cyclops.collectionx.persistent.anyM;

import com.aol.cyclops2.types.anyM.AnyMSeq;
import cyclops.collectionx.AbstractAnyMSeqTest;
import cyclops.collectionx.immutable.BagX;
import cyclops.control.anym.AnyM;
import cyclops.control.anym.Witness;
import org.junit.Ignore;
import org.junit.Test;

import static java.util.Comparator.comparing;
import static cyclops.data.tuple.Tuple.tuple;
import static org.junit.Assert.assertEquals;

public class BagXTest extends AbstractAnyMSeqTest<Witness.bagX> {

	@Override
	public <T> AnyMSeq<Witness.bagX,T> of(T... values) {
		return AnyM.fromBagX(BagX.of(values));
	}

	/* (non-Javadoc)
	 * @see com.aol.cyclops2.function.collections.extensions.AbstractCollectionXTest#zero()
	 */
	@Override
	public <T> AnyMSeq<Witness.bagX,T> empty() {
		return AnyM.fromBagX(BagX.empty());
	}
	 /* (non-Javadoc)
     * @see com.aol.cyclops2.function.collections.extensions.AbstractAnyMSeqTest#whenGreaterThan2()
     */
    @Override
    @Test
    public void whenGreaterThan2() {
       
    }

    @Test
    public void testRetry(){
        of(1,2,3).retry(i->i+2).printOut();
    }

	@Test @Ignore
	public void testSorted() {



	}
}

@@ -174,16 +174,51 @@
 e.BagX;%0A
+import cyclops.companion.Reducers;%0A
 import c
@@ -243,16 +243,16 @@
 m.AnyM;%0A
-
 import c
@@ -329,16 +329,55 @@
 .Test;%0A%0A
+import static java.util.Arrays.asList;%0A
 import s
@@ -482,33 +482,162 @@
 org.
-junit.Assert.assertEquals
+hamcrest.Matchers.hasItems;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertThat
 ;%0A%0Ap
@@ -1361,13 +1361,177 @@
 () %7B%0A%0A%0A%0A
+%09%7D%0A%09@Test%0A%09public void testScanLeftStringConcatMonoid() %7B%0A%09%09assertThat(of(%22a%22, %22b%22, %22c%22).scanLeft(Reducers.toString(%22%22)).toList(), hasItems(%22%22, %22a%22, %22ab%22, %22abc%22));%0A
 %09%7D%0A%7D%0A

test fixes