Reversed implements Iterable<T> { public static <T> Reversed<T> list(List<T> l) { return new Reversed<T>(l); } private  Reversed(List<T> l); static Reversed<T> list(List<T> l); Iterator<T> iterator();  }
@Test public void testReversion() { List<String> ss = new ArrayList<String>(); ss.add("a"); ss.add("b"); ss.add("c"); String log = ""; for (String s : ss) { log += s; } for (String s : Reversed.list(ss)) { log += s; } assertEquals("abccba", log); }