while (combinationsIterator.hasNext()) { int[] combination = combinationsIterator.next(); System.out.println(Arrays.toString(combination)); }