@@ -0,0 +1,961 @@
+package com.kryptnostic.rhizome.hazelcast.serializers;%0A%0Aimport java.io.IOException;%0Aimport java.util.Set;%0Aimport java.util.function.Consumer;%0A%0Aimport jersey.repackaged.com.google.common.collect.Sets;%0A%0Aimport com.google.common.base.Function;%0Aimport com.hazelcast.nio.ObjectDataInput;%0Aimport com.hazelcast.nio.ObjectDataOutput;%0A%0Apublic class SetStreamSerializers %7B%0A%0A    public static %3CT%3E void serialize( ObjectDataOutput out , Set%3CT%3E elements, Consumer%3CT%3E c ) throws IOException %7B%0A        out.writeInt( elements.size() );%0A        elements.forEach( c );%0A    %7D%0A%0A    public static %3CT%3E Set%3CT%3E deserialize( ObjectDataInput in, Function%3CObjectDataInput, T%3E f ) throws IOException %7B%0A        int size = in.readInt();%0A        Set%3CT%3E s = Sets.newHashSetWithExpectedSize( size );%0A        for ( int i = 0; i %3C size; ++i ) %7B%0A            T elem = f.apply( in );%0A            if ( elem != null ) %7B%0A                s.add( elem );%0A            %7D%0A        %7D%0A        return s;%0A    %7D%0A%7D%0A

Set serializer helpers.