static int countOccurrences(Iterable c, A x) { int n = 0; if (c != null) for (O o : c) if (eq(x, o)) ++n; ret n; }