using System;
using edu.neu.ccs.demeterf.lib;

public class MapTest{
    static void p(String s){ Console.WriteLine(s); }
    public static void Main(String[] args){
        Map<int,string> m = Map<int,string>.create<int>();
        for(int i = 0; i < 5; i++){
            m = m.put(i, "\""+i+"\"");
        }
        p("      A Map: "+m);
        p("     Put(5): "+m.put(5,"\"5\""));
        p("        Get: "+m.get(3));
        p("   Remap(3): "+m.remap(3,"\"three\""));
        p("Contains(2): "+m.containsKey(2));
        p("Contains(6): "+m.containsKey(6));
        p("   Merge: "+m.merge(m,new Mrg()));

        foreach(Entry<int,string> e in m)
            p("E : "+e);
        
    }
    class Mrg : Map<int,string>.Merge{
        public override string merge(string s, string u){ return s+u; }
    }
}