Why doesn't this code attempting to use Hamcrest's hasItems compile?

前端 未结 9 1845
耶瑟儿~
耶瑟儿~ 2020-12-03 00:49

Why does this not compile, oh, what to do?

import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItems;

ArrayList<         


        
9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 00:52

    Try

    assertThat(actual, hasItems(expected.toArray(new Integer[0])));
    

    to satisfy the matcher signature. No Eclipse around, so this might not work.

提交回复
热议问题