Testing cardinality restrictions