ConcatMap implements Map<String, Object>, Serializable, KryoSerializable { @Override public Object put(String key, Object value) { throw new UnsupportedOperationException("Merged map is immutable."); } ConcatMap(List<Map> variableMappings); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Object get(Object key); @Override Object put(String key, Object value); @Override Object remove(Object key); @Override void putAll(Map<? extends String, ?> m); @Override void clear(); @Override @SuppressWarnings("unchecked") Set<String> keySet(); @Override @SuppressWarnings("unchecked") Collection<Object> values(); @Override @SuppressWarnings("unchecked") Set<Entry<String, Object>> entrySet(); @Override @SuppressWarnings("unchecked") String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override void write(Kryo kryo, Output output); @Override void read(Kryo kryo, Input input);  }
@Test public void testKryoSerialization() { Map<String, Object> v1 = new HashMap<>(); v1.put("k1", "v1"); Map<String, Object> v2 = new HashMap<>(); v2.put("k2", "v2"); v2.put("k3", null); { ConcatMap c = create(v1, v2); assertKryoserializable(c); } { ConcatMap c = create(v1); assertKryoserializable(c); } { ConcatMap c = create(); assertKryoserializable(c); } }