CollectionUtil { public <A extends ABSValue,B> java.util.List<B> convert(Fun<A,B> f, List<A> absList) { java.util.List<B> list = new ArrayList<B>(); while (absList.isCons()) { List_Cons<A> cons = absList.toCons(); list.add(f.evaluate(cons.getArg0())); absList = cons.getArg1(); } return list; }  java.util.List<B> convert(Fun<A,B> f, List<A> absList); List<A> convert(Fun<B,A> f, java.util.List<B> List); java.util.Set<B> convert(Fun<A,B> f, Set<A> absSet); Set<A> convert(Fun<B,A> f, java.util.Set<B> set); java.util.Map<B, D> convert(Fun<A,B> f, Fun<C,D> g, Map<A, C> absMap); Map<A, C> convert(Fun<B,A> f, Fun<D,C> g, java.util.Map<B, D> map); java.util.List<A> convert(List<A> absList); List<A> convert(java.util.List<A> List); java.util.Set<A> convert(Set<A> absSet); Set<A> convert(java.util.Set<A> set); java.util.Map<A, B> convert(Map<A, B> absMap); Map<A, B> convert(java.util.Map<A, B> map);  }
@Test public final void testConvertListOfA() { List<ABSInteger> lint = cons(1,cons(2,cons(3,new List_Nil<ABSInteger>()))); java.util.List<ABSInteger> rint = Arrays.asList(fromInt(1),fromInt(2),fromInt(3)); assertTrue(tutil.equals(INT_COMP,rint,util.convert(lint))); }
@Test public final void testConvertListOfA1() { java.util.List<ABSInteger> rint = Arrays.asList(fromInt(1),fromInt(2),fromInt(3)); List<ABSInteger> lint = cons(1,cons(2,cons(3,new List_Nil<ABSInteger>()))); assertTrue(tutil.equals(INT_COMP,lint,util.convert(rint))); }