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

        // ImmutableMap is used by ImmutableMultimap. However,
        // we already have a separate serializer class for ImmutableMap,
        // ImmutableMapSerializer. If it is not already being used, register it.
        Serializer immutableMapSerializer = getSerializer(kryo, ImmutableMap.class);
        if (!(immutableMapSerializer instanceof ImmutableMapSerializer)) {
            ImmutableMapSerializer.registerSerializers(kryo);
        }

        // ImmutableList is used by ImmutableListMultimap. However,
        // we already have a separate serializer class for ImmutableList,
        // ImmutableListSerializer. If it is not already being used, register it.
        Serializer immutableListSerializer = getSerializer(kryo, ImmutableList.class);
        if (!(immutableListSerializer instanceof ImmutableListSerializer)) {
            ImmutableListSerializer.registerSerializers(kryo);
        }

        // ImmutableSet is used by ImmutableSetMultimap. However,
        // we already have a separate serializer class for ImmutableSet,
        // ImmutableSetSerializer. If it is not already being used, register it.
        Serializer immutableSetSerializer = getSerializer(kryo, ImmutableSet.class);
        if (!(immutableSetSerializer instanceof ImmutableSetSerializer)) {
            ImmutableSetSerializer.registerSerializers(kryo);
        }

        final ImmutableMultimapSerializer serializer = new ImmutableMultimapSerializer();

        // ImmutableMultimap (abstract class)
        //  +- EmptyImmutableListMultimap
        //  +- ImmutableListMultimap
        //  +- EmptyImmutableSetMultimap
        //  +- ImmutableSetMultimap

        kryo.register(ImmutableMultimap.class, serializer);
        kryo.register(ImmutableListMultimap.of().getClass(), serializer);
        kryo.register(ImmutableListMultimap.of("A", "B").getClass(), serializer);
        kryo.register(ImmutableSetMultimap.of().getClass(), serializer);
        kryo.register(ImmutableSetMultimap.of("A", "B").getClass(), serializer);
    }
public static void registerSerializers(final Kryo kryo) {

        // ImmutableMap is used by ImmutableMultimap. However,
        // we already have a separate serializer class for ImmutableMap,
        // ImmutableMapSerializer. If it is not already being used, register it.
        Serializer immutableMapSerializer = getSerializer(kryo, ImmutableMap.class);
        if (!(immutableMapSerializer instanceof ImmutableMapSerializer)) {
            ImmutableMapSerializer.registerSerializers(kryo);
        }

        // ImmutableList is used by ImmutableListMultimap. However,
        // we already have a separate serializer class for ImmutableList,
        // ImmutableListSerializer. If it is not already being used, register it.
        Serializer immutableListSerializer = getSerializer(kryo, ImmutableList.class);
        if (!(immutableListSerializer instanceof ImmutableListSerializer)) {
            ImmutableListSerializer.registerSerializers(kryo);
        }

        // ImmutableSet is used by ImmutableSetMultimap. However,
        // we already have a separate serializer class for ImmutableSet,
        // ImmutableSetSerializer. If it is not already being used, register it.
        Serializer immutableSetSerializer = getSerializer(kryo, ImmutableSet.class);
        if (!(immutableSetSerializer instanceof ImmutableSetSerializer)) {
            ImmutableSetSerializer.registerSerializers(kryo);
        }

        final ImmutableMultimapSerializer serializer = new ImmutableMultimapSerializer();

        // ImmutableMultimap (abstract class)
        //  +- EmptyImmutableListMultimap
        //  +- ImmutableListMultimap
        //  +- EmptyImmutableSetMultimap
        //  +- ImmutableSetMultimap

        kryo.register(ImmutableMultimap.class, serializer);
        kryo.register(ImmutableListMultimap.of().getClass(), serializer);
        kryo.register(ImmutableListMultimap.of("A", "B").getClass(), serializer);
        kryo.register(ImmutableSetMultimap.of().getClass(), serializer);
        kryo.register(ImmutableSetMultimap.of("A", "B").getClass(), serializer);
    }
public static void registerSerializers ( final Kryo kryo ) { // ImmutableMap is used by ImmutableMultimap. However, // we already have a separate serializer class for ImmutableMap, // ImmutableMapSerializer. If it is not already being used, register it. Serializer immutableMapSerializer = getSerializer ( kryo , ImmutableMap . class ) ; if ( ! ( immutableMapSerializer instanceof ImmutableMapSerializer ) ) { ImmutableMapSerializer . registerSerializers ( kryo ) ; } // ImmutableList is used by ImmutableListMultimap. However, // we already have a separate serializer class for ImmutableList, // ImmutableListSerializer. If it is not already being used, register it. Serializer immutableListSerializer = getSerializer ( kryo , ImmutableList . class ) ; if ( ! ( immutableListSerializer instanceof ImmutableListSerializer ) ) { ImmutableListSerializer . registerSerializers ( kryo ) ; } // ImmutableSet is used by ImmutableSetMultimap. However, // we already have a separate serializer class for ImmutableSet, // ImmutableSetSerializer. If it is not already being used, register it. Serializer immutableSetSerializer = getSerializer ( kryo , ImmutableSet . class ) ; if ( ! ( immutableSetSerializer instanceof ImmutableSetSerializer ) ) { ImmutableSetSerializer . registerSerializers ( kryo ) ; } final ImmutableMultimapSerializer serializer = new ImmutableMultimapSerializer ( ) ; // ImmutableMultimap (abstract class) //  +- EmptyImmutableListMultimap //  +- ImmutableListMultimap //  +- EmptyImmutableSetMultimap //  +- ImmutableSetMultimap kryo . register ( ImmutableMultimap . class , serializer ) ; kryo . register ( ImmutableListMultimap . of ( ) . getClass ( ) , serializer ) ; kryo . register ( ImmutableListMultimap . of ( "A" , "B" ) . getClass ( ) , serializer ) ; kryo . register ( ImmutableSetMultimap . of ( ) . getClass ( ) , serializer ) ; kryo . register ( ImmutableSetMultimap . of ( "A" , "B" ) . getClass ( ) , serializer ) ; }
Creates a new {@link ImmutableMultimapSerializer} and registers its serializer
for the several ImmutableMultimap related classes.

@param kryo the {@link Kryo} instance to set the serializer on
Creates a new { @link ImmutableMultimapSerializer } and registers its serializer for the several ImmutableMultimap related classes .