static ArrayList emptyList() { ret new ArrayList; //ret Collections.emptyList(); } static ArrayList emptyList(int capacity) { ret new ArrayList(max(0, capacity)); } // Try to match capacity static ArrayList emptyList(Iterable l) { ret l instanceof Collection ? emptyList(((Collection) l).size()) : emptyList(); } static ArrayList emptyList(O[] l) { ret emptyList(l(l)); } // get correct type at once static ArrayList emptyList(Class c) { ret new ArrayList; }