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

         final MapSerializer serializer = new MapSerializer();

         kryo.register(Map.class, serializer);
         kryo.register(Maps.of().getClass(), serializer);

         Object o1 = new Object();
         Object o2 = new Object();
         Object o3 = new Object();
         Object o4 = new Object();
         Object o5 = new Object();

         kryo.register(Maps.of(o1, o1).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2, o3, o3).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2, o3, o3, o4, o4).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2, o3, o3, o4, o4, o5, o5).getClass(), serializer);

     }
public static void registerSerializers(final Kryo kryo) {

         final MapSerializer serializer = new MapSerializer();

         kryo.register(Map.class, serializer);
         kryo.register(Maps.of().getClass(), serializer);

         Object o1 = new Object();
         Object o2 = new Object();
         Object o3 = new Object();
         Object o4 = new Object();
         Object o5 = new Object();

         kryo.register(Maps.of(o1, o1).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2, o3, o3).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2, o3, o3, o4, o4).getClass(), serializer);
         kryo.register(Maps.of(o1, o1, o2, o2, o3, o3, o4, o4, o5, o5).getClass(), serializer);

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

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