コード例 #1
0
 @Override
 public void partitionWith() {
   PartitionImmutableBag<String> partition =
       this.newBag().partitionWith(Predicates2.<String>lessThan(), "0");
   Verify.assertIterableEmpty(partition.getSelected());
   Verify.assertIterableEmpty(partition.getRejected());
 }
コード例 #2
0
  @Test
  public void partition() {
    ImmutableBag<String> strings = this.newBag();
    PartitionImmutableBag<String> partition = strings.partition(Predicates.greaterThan("0"));
    Assert.assertEquals(strings, partition.getSelected());
    Verify.assertIterableEmpty(partition.getRejected());

    Verify.assertIterableSize(
        strings.size() - 1, strings.partition(Predicates.greaterThan("1")).getSelected());
  }