static Collection combinedCollection(final Collection a, final Collection b) { if (empty(a)) ret b; if (empty(b)) ret a; ret new AbstractCollection { public int size() { ret a.size() + b.size(); } // >= real value public bool contains(O o) { ret a.contains(o) || b.contains(o); } public Iterator iterator() { fail("not implemented"); } }; }