static void migrateList(Collection extends A> a, Collection b) { if (b != null && a != null) { b.addAll(a); a.clear(); } }