Hamcrestには、コレクションの内容をアサーションするためのいくつかのマッチャが用意されています。これらの例はすべて、合格:HamCrestのhasItems、containsおよびcontainsInAnyOrderはどのように異なるのですか?
Collection<String> c = ImmutableList.of("one", "two", "three");
assertThat(c, hasItems("one", "two", "three");
assertThat(c, contains("one", "two", "three");
assertThat(c, containsInAnyOrder("one", "two", "three");
はどのようhasItems
、contains
とcontainsInAnyOrder
が異なるのですか?