return result.toImmutable();
}
public ImmutableByteBag collectByte(final ByteFunction<? super T> byteFunction)
{
final ByteHashBag result = new ByteHashBag(this.size());
this.forEachWithOccurrences(new ObjectIntProcedure<T>()
{
public void value(T each, int occurrences)
{
result.addOccurrences(byteFunction.byteValueOf(each), occurrences);
}
});
return result.toImmutable();
}