コード例 #1
0
 @Test
 public void collectBoolean() {
   ImmutableCollection<Integer> integers = this.classUnderTest();
   ImmutableBooleanCollection immutableCollection =
       integers.collectBoolean(PrimitiveFunctions.integerIsPositive());
   Verify.assertSize(1, immutableCollection);
 }
コード例 #2
0
 @Override
 @Test
 public void collectBoolean() {
   MutableBag<Integer> integers = UnmodifiableBag.of(HashBag.newBagWith(0, 1, 2, 2));
   Assert.assertEquals(
       BooleanHashBag.newBagWith(false, true, true, true),
       integers.collectBoolean(PrimitiveFunctions.integerIsPositive()));
 }