return result.toImmutable();
}
public ImmutableShortBag collectShort(final ShortFunction<? super T> shortFunction)
{
final ShortHashBag result = new ShortHashBag(this.size());
this.forEachWithOccurrences(new ObjectIntProcedure<T>()
{
public void value(T each, int occurrences)
{
result.addOccurrences(shortFunction.shortValueOf(each), occurrences);
}
});
return result.toImmutable();
}