@Test public void collectWith() { ImmutableBag<String> strings = this.newBag(); String argument = "thing"; Assert.assertEquals( strings, strings.collectWith(this.generateAssertingPassThroughFunction2(argument), argument)); }
@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); }