package client;

import com.google.gwt.junit.client.GWTTestCase;
import javaslang.Function1;
import javaslang.Tuple;
import javaslang.Tuple1;
import javaslang.collection.*;

public class GwtTestCollections extends GWTTestCase {

    @Override
    public String getModuleName() {
        return "TestModule";
    }

    public void testTuple() {
        Tuple1<Integer> t = Tuple.of(1);
        assertEquals((int) t._1(), 1);
    }

    private void applyCollection(Function1<char[], Traversable<Character>> factory) {
        Traversable<Character> traversable = factory.apply(new char[] {'a', 'b', 'c'});
        assertEquals(traversable.count(i -> i != 'b'), 2);
    }

    public void testCompileArray() {
        applyCollection(Array::ofAll);
    }

    public void testCompileBitSet() {
        applyCollection(BitSet::ofAll);
    }

    public void testCompileCharSeq() {
        applyCollection(chars -> CharSeq.of(new String(chars)));
    }

    public void testCompileHashSet() {
        applyCollection(HashSet::ofAll);
    }

    public void testCompileLinkedHashSet() {
        applyCollection(LinkedHashSet::ofAll);
    }

    public void testCompileList() {
        applyCollection(List::ofAll);
    }

    public void testCompilePriorityQueue() {
        applyCollection(chars -> PriorityQueue.ofAll(List.ofAll(chars)));
    }

    public void testCompileQueue() {
        applyCollection(Queue::ofAll);
    }

    public void testCompileTreeSet() {
        applyCollection(chars -> TreeSet.ofAll(List.ofAll(chars)));
    }

    public void testCompileVector() {
        applyCollection(Vector::ofAll);
    }
}
@@ -919,19 +919,26 @@
 q.of
-(new String
+All(Iterator.ofAll
 (cha
@@ -1312,28 +1312,32 @@
 Queue.ofAll(
-List
+Iterator
 .ofAll(chars
@@ -1517,20 +1517,24 @@
 t.ofAll(
-List
+Iterator
 .ofAll(c

apply PR comments