return result.toImmutable();
}
public ImmutableDoubleBag collectDouble(final DoubleFunction<? super T> doubleFunction)
{
final DoubleHashBag result = new DoubleHashBag(this.size());
this.forEachWithOccurrences(new ObjectIntProcedure<T>()
{
public void value(T each, int occurrences)
{
result.addOccurrences(doubleFunction.doubleValueOf(each), occurrences);
}
});
return result.toImmutable();
}