import edu.rice.cs.mint.runtime.Code;
import java.util.ArrayList;

public class ArrayListSample {
    public static void main(String[] args) {
        ArrayList<Code<Integer>> l = new ArrayList<Code<Integer>>();
        
        for(int i=0; i<10; ++i) {
            final int j = i;
            l.add(<|j|>);
        }
        
        for(Code<Integer> c: l) {
            System.out.println(c.run());
        }
        
        Code<Integer> sum = <| 0 |>;
        for(Code<Integer> c: l) {
            sum = <| `sum + `c |>;
        }
        
        System.out.println("sum: "+sum.run());
        
        Code<ArrayList<Code<Integer>>> caci = <| new ArrayList<Code<Integer>>() |>;
        ArrayList<Code<Integer>> aci = caci.run();
        
        Code<ArrayList<Code<Integer>>> caci2 = <| `caci |>;
    }
}
