@Test public void test2() { List<String> l1 = new ArrayList<>(); List<String> l2 = new ArrayList<>(); Collections.addAll(l1, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); Collections.addAll(l2, "A", "B", "C", "D", "E", "F", "G", "H", "I", "J"); Tuples<String> t = new Tuples(l1, l2); Iterator<List<String>> itr = t.tuples(); int count = 0; int expectedCount = l1.size() * l2.size(); for (String x1 : l1) { for (String x2 : l2) { Assert.assertTrue(itr.hasNext()); List<String> item = itr.next(); Assert.assertEquals(x1, item.get(0)); Assert.assertEquals(x2, item.get(1)); count++; } } Assert.assertEquals(expectedCount, count); }
public Tuples() { }
Tuples { public Tuples() { } }
Tuples { public Tuples() { } Tuples();  Tuples(Collection<T>... coll);  Tuples(List<Collection<T>> collections); }
Tuples { public Tuples() { } Tuples();  Tuples(Collection<T>... coll);  Tuples(List<Collection<T>> collections); void add(Iterable<T> c); Iterator<List<T>> tuples(); }
Tuples { public Tuples() { } Tuples();  Tuples(Collection<T>... coll);  Tuples(List<Collection<T>> collections); void add(Iterable<T> c); Iterator<List<T>> tuples();  }