@Test public void testOf() { List<Character> list = Arrays.asList('a', 'b', 'c', 'd'); int localCount = 0; for (Enumerated<Character> countingChar : EnumeratingIterator.of(list)) { int counted = countingChar.count(); assertEquals("count", localCount, counted); assertEquals("value", list.get(localCount), countingChar.get()); ++localCount; } }
public static <T> EnumeratingIterator<T> of(Iterable<T> iterable) { return new EnumeratingIterator<>(iterable); }
EnumeratingIterator implements Iterable<Enumerated<T>> { public static <T> EnumeratingIterator<T> of(Iterable<T> iterable) { return new EnumeratingIterator<>(iterable); } }
EnumeratingIterator implements Iterable<Enumerated<T>> { public static <T> EnumeratingIterator<T> of(Iterable<T> iterable) { return new EnumeratingIterator<>(iterable); } EnumeratingIterator(Iterable<T> iterable); }
EnumeratingIterator implements Iterable<Enumerated<T>> { public static <T> EnumeratingIterator<T> of(Iterable<T> iterable) { return new EnumeratingIterator<>(iterable); } EnumeratingIterator(Iterable<T> iterable); static EnumeratingIterator<T> of(Iterable<T> iterable); @Override Iterator<Enumerated<T>> iterator(); }
EnumeratingIterator implements Iterable<Enumerated<T>> { public static <T> EnumeratingIterator<T> of(Iterable<T> iterable) { return new EnumeratingIterator<>(iterable); } EnumeratingIterator(Iterable<T> iterable); static EnumeratingIterator<T> of(Iterable<T> iterable); @Override Iterator<Enumerated<T>> iterator();  }