static int countOccurrences_id(Collection c, O x) { int n = 0; if (c != null) for (O o : c) if (o == x) ++n; ret n; }