我想要一個簡單的Hamcrest匹配器,用於查找List<String>中某個對象的重複項。這就是我寫的 for (QuizEntity quiz : quizzes)
for (QuestionEntity question : quiz.getQuestions())
Assert.assertThat("There should be no duplicate
我感到很震驚,沿着線的東西: assertThat(null, either(is(nullValue())).or(notNullValue()));
與失敗: java.lang.AssertionError:
Expected: (is null or not null)
but: was null
at org.hamcrest.MatcherAssert.ass