public class FilteredRangeIteratorTest extends TestCase {
private static final List<String> LIST = Arrays.asList("x", "y", "z");
public void testMatchAll() {
RangeIterator iterator = new FilteredRangeIterator(LIST.iterator());
assertEquals(3, iterator.getSize());
assertEquals(0, iterator.getPosition());
assertTrue(iterator.hasNext());
assertEquals("x", iterator.next());
assertEquals(1, iterator.getPosition());
assertTrue(iterator.hasNext());
assertEquals("y", iterator.next());
assertEquals(2, iterator.getPosition());
assertTrue(iterator.hasNext());
assertEquals("z", iterator.next());
assertEquals(3, iterator.getPosition());
assertFalse(iterator.hasNext());
}