@Test
 public void collectDoubleWithTarget() {
   DoubleHashBag target = new DoubleHashBag();
   DoubleHashBag result = this.newBag().collectDouble(Double::parseDouble, target);
   Assert.assertSame("Target sent as parameter not returned", target, result);
   Assert.assertEquals(this.numKeys(), result.sizeDistinct());
   for (int i = 1; i <= this.numKeys(); i++) {
     Assert.assertEquals(i, result.occurrencesOf(i));
   }
 }
 @Override
 @Test
 public void collectDouble() {
   MutableBag<Integer> integers = UnmodifiableBag.of(HashBag.newBagWith(1, 2, 2, 3, 3, 3));
   Assert.assertEquals(
       DoubleHashBag.newBagWith(1.0d, 2.0d, 2.0d, 3.0d, 3.0d, 3.0d),
       integers.collectDouble(PrimitiveFunctions.unboxIntegerToDouble()));
 }