public void writeExternal(final ObjectOutput out) throws IOException
{
out.writeInt(this.bag.sizeDistinct());
try
{
this.bag.forEachWithOccurrences(new CheckedBooleanIntProcedure()
{
@Override
public void safeValue(boolean item, int count) throws IOException
{
out.writeBoolean(item);