Пример #1
0
  @Test
  public void collectWith() {
    ImmutableBag<String> strings = this.newBag();

    String argument = "thing";
    Assert.assertEquals(
        strings,
        strings.collectWith(this.generateAssertingPassThroughFunction2(argument), argument));
  }
Пример #2
0
  @Test
  public void collectWith_target() {
    ImmutableBag<String> strings = this.newBag();

    String argument = "thing";
    HashBag<String> targetCollection = HashBag.<String>newBag();
    HashBag<String> actual =
        strings.collectWith(
            this.generateAssertingPassThroughFunction2(argument), argument, targetCollection);
    Assert.assertEquals(strings, actual);
    Assert.assertSame(targetCollection, actual);
  }