### Question:
MapDictionary extends Dictionary { @Override public int add(byte[] bytes) { ByteArrayList value = new ByteArrayList(bytes); int id = value2Id.getInt(value); if (id == -1) { id = id2Value.size(); value2Id.put(value, id); id2Value.add(value); } else { throw new IllegalStateException("there already was an element " + Arrays.toString(bytes)); } return id; } MapDictionary();  MapDictionary(DictionaryId dictionaryId); @JsonCreator  MapDictionary(DatasetId datasetId, String name, byte[][] id2Value); @JsonProperty byte[][] getId2Value(); @Override int add(byte[] bytes); @Override int put(byte[] bytes); @Override int getId(byte[] bytes); @Override byte[] getElement(int id); @Override int size(); @Override Iterator<DictionaryEntry> iterator(); static long estimateMemoryConsumption(long entries, long totalBytes); @Override long estimateMemoryConsumption();  }### Answer:
@Test void testSerializationAsList() throws IOException, JSONException { MapDictionary map = new MapDictionary(new DictionaryId(new DatasetId("dataset"), "dictionary")); DirectDictionary direct = new DirectDictionary(map); direct.add("a"); direct.add("b"); direct.add("c"); String json = Jackson.MAPPER.writeValueAsString(map); assertThat(json) .startsWith("{\"type\":\"MAP_DICTIONARY\",\"name\":\"dictionary\",\"id2Value\":[") .endsWith("],\"dataset\":\"dataset\"}"); SerializationTestUtil .forType(MapDictionary.class) .test(map); }