static int countOccurrences_optimizedForZero(S s, S x) { ret !contains(s, x) ? 0 : countOccurrences(s, x); }