}
@Override
public <K, V> void testMap(Map<K, V> v, Class<K> keyElementClass, Class<V> valueElementClass) throws Exception {
MessagePack msgpack = new MessagePack();
Unconverter packer = new Unconverter(msgpack);
if (v == null) {
packer.writeNil();
} else {
packer.writeMapBegin(v.size());
for (Map.Entry<K, V> e : ((Map<K, V>) v).entrySet()) {
packer.write(e.getKey());
packer.write(e.getValue());
}
packer.writeMapEnd();
}
Value r = packer.getResult();
Converter unpacker = new Converter(msgpack, r);
if (unpacker.trySkipNil()) {
assertEquals(null, v);
return;
}