static int count(Collection l, O o) { int count = 0; for (O x : l) if (eq(x, o)) ++count; ret count; }