static int countNotNull(Collection c) { int n = 0; if (c != null) for (O a : c) if (a != null) ++n; ret n; }