static HashMap listToHashMap(L l) { if (l == null) null; new HashMap map; int n = l(l); for i to n: map.put(i, l.get(i)); ret map; }