package net.hillsdon.fij.core;

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static net.hillsdon.fij.core.Functional.list;
import static net.hillsdon.fij.core.IterableUtils.reversed;

import java.util.List;

import junit.framework.TestCase;

public class TestIterableUtils extends TestCase {

  public void testReversed() {
    List<Integer> data = asList(1, 2, 3);
    assertEquals(asList(3, 2, 1), list(reversed(data)));
    assertEquals(emptyList(), list(reversed(emptyList())));
  }
  
}

@@ -225,16 +225,71 @@
 ersed;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Iterator;%0A
 import j
@@ -445,16 +445,39 @@
  data = 
+new ArrayList%3CInteger%3E(
 asList(1
@@ -483,16 +483,17 @@
 1, 2, 3)
+)
 ;%0A    as
@@ -603,16 +603,218 @@
 t())));%0A
+    %0A    Iterator%3CInteger%3E iter = reversed(data).iterator();%0A    iter.next();%0A    iter.next();%0A    iter.remove();%0A    iter.next();%0A    assertFalse(iter.hasNext());%0A    assertEquals(asList(1, 3), data);%0A
   %7D%0A  %0A%7D

Test we delegate remove too.