static bool setAddAllFirstQuick(L a, Collection b) { HashSet index = new HashSet(a); new L l2; for (A x : b) if (!index.contains(x)) { l2.add(x); index.add(x); } if (nempty(l2)) { a.addAll(0, l2); true; } false; }