return result.toImmutable();
}
public ImmutableLongBag collectLong(final LongFunction<? super T> longFunction)
{
final LongHashBag result = new LongHashBag(this.size());
this.forEachWithOccurrences(new ObjectIntProcedure<T>()
{
public void value(T each, int occurrences)
{
result.addOccurrences(longFunction.longValueOf(each), occurrences);
}
});
return result.toImmutable();
}