lib/collections: add `Collection::has_exactly`