src/main/java/de/javakaffee/kryoserializers/dexx/SetSerializer.java
public static void registerSerializers(final Kryo kryo) {

        final SetSerializer serializer = new SetSerializer();

        kryo.register(Set.class, serializer);

        // Note:
        //  Only registering above is good enough for serializing/deserializing.
        //  but if using Kryo#copy, following is required.

        kryo.register(Sets.of().getClass(), serializer);
        kryo.register(Sets.of(1).getClass(), serializer);
        kryo.register(Sets.of(1,2,3).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8,9).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8,9,10).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8,9,10,11).getClass(), serializer);

    }
public static void registerSerializers(final Kryo kryo) {

        final SetSerializer serializer = new SetSerializer();

        kryo.register(Set.class, serializer);

        // Note:
        //  Only registering above is good enough for serializing/deserializing.
        //  but if using Kryo#copy, following is required.

        kryo.register(Sets.of().getClass(), serializer);
        kryo.register(Sets.of(1).getClass(), serializer);
        kryo.register(Sets.of(1,2,3).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8,9).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8,9,10).getClass(), serializer);
        kryo.register(Sets.of(1,2,3,4,5,6,7,8,9,10,11).getClass(), serializer);

    }
Creates a new {@link ImmutableSetSerializer} and registers its serializer
for the several ImmutableSet related classes.

@param kryo the {@link Kryo} instance to set the serializer on