static void addIfInstanceOf(Collection l, Class c, O a) { if (l != null && instanceOf(c, a)) l.add((A) a); }