示例#1
0
 @Test
 public void testForEachWith() {
   MutableList<String> result = Lists.mutable.of();
   MutableList<String> source = Lists.fixedSize.of("1", "2", "3", "4", "5", "6");
   source.forEachWith(Procedures2.fromProcedure(CollectionAddProcedure.on(result)), null);
   Assert.assertEquals(FastList.newListWith("1", "2", "3", "4", "5", "6"), result);
 }
示例#2
0
 @Override
 @Test
 public void forEachKey() {
   MutableList<Integer> collection = Lists.mutable.of();
   MutableMap<Integer, String> map = new SingletonMap<Integer, String>(1, "1");
   map.forEachKey(CollectionAddProcedure.on(collection));
   Assert.assertEquals(FastList.newListWith(1), collection);
 }