@Override
public <R extends MutableDoubleCollection> R collectDouble(final DoubleFunction<? super T> doubleFunction, final R target)
{
if (target instanceof MutableDoubleBag)
{
final MutableDoubleBag targetBag = (MutableDoubleBag) target;
this.forEachWithOccurrences(new ObjectIntProcedure<T>()
{
public void value(T each, int occurrences)
{
targetBag.addOccurrences(doubleFunction.doubleValueOf(each), occurrences);
}
});
}
else
{