コード例 #1
0
 @Test
 public void collectIfOver100() {
   ArrayList<Integer> list = new ArrayList<Integer>(Interval.oneTo(101));
   ArrayList<Class<?>> result =
       ArrayListIterate.collectIf(list, Predicates.equal(101), Functions.getToClass());
   Assert.assertEquals(FastList.newListWith(Integer.class), result);
 }
コード例 #2
0
 @Test
 public void collectOver100() {
   ArrayList<Integer> list = new ArrayList<Integer>(Interval.oneTo(101));
   ArrayList<Class<?>> newCollection = ArrayListIterate.collect(list, Functions.getToClass());
   Verify.assertSize(101, newCollection);
   Verify.assertContains(Integer.class, newCollection);
 }