我需要一个匹配器,比如:
它是某种hasExactlyItems()或containsInAnyOrderAndCardinality()
我建议使用 AssertJ 为此目的。它对集合有很多流畅的断言,比如: