static void addAllNonNulls(Collection c, Iterable b) { if (c != null && b != null) for (A a : b) if (a != null) c.add(a); } static void addAllNonNulls(Collection c, B... b) { if (c != null && b != null) for (A a : b) if (a != null) c.add(a); }