JUnit リストの比較
Eclipse で、JUnit を書いていると、コード補完でうまく出てこなくて
いつもイライラするので、メモ
import org.hamcrest.CoreMatchers; import org.hamcrest.MatcherAssert;
MatcherAssert.assertThat(list1, CoreMatchers.is(list2)); MatcherAssert.assertThat(list1, CoreMatchers.hasItem("b")); MatcherAssert.assertThat(null, CoreMatchers.nullValue()); MatcherAssert.assertThat(list1, CoreMatchers.is(list2));