@@ -0,0 +1,1788 @@
+package info.metadude.java.library.halfnarp.test;%0A%0Aimport com.fasterxml.jackson.core.JsonFactory;%0Aimport com.fasterxml.jackson.core.JsonGenerator;%0Aimport info.metadude.java.library.halfnarp.TalkIdsSerializer;%0Aimport info.metadude.java.library.halfnarp.model.TalkIds;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.io.StringWriter;%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class TalkIdsSerializerTest %7B%0A%0A    protected final ArrayList%3CInteger%3E TALK_IDS = new ArrayList%3C%3E(Arrays.asList(5931, 5930));%0A%0A    protected final static String EXPECTED_TALK_IDS_JSON = %22%7B%5C%22talk_ids%5C%22:%5B5931,5930%5D%7D%22;%0A%0A    protected TalkIdsSerializer talkIdsSerializer;%0A%0A    @Before%0A    public void setup() throws IOException %7B%0A        talkIdsSerializer = new TalkIdsSerializer();%0A    %7D%0A%0A    @Test%0A    public void testSerialize() throws IOException %7B%0A        String jsonizedTalkIds = getSerializedTalkIds(talkIdsSerializer, TALK_IDS);%0A        // Expect talk IDs as JSON%0A        assertNotNull(jsonizedTalkIds);%0A        assertTrue(jsonizedTalkIds.length() %3E 0);%0A        assertEquals(jsonizedTalkIds, EXPECTED_TALK_IDS_JSON);%0A    %7D%0A%0A    private static String getSerializedTalkIds(TalkIdsSerializer talkIdsSerializer, List%3CInteger%3E talkIdList)%0A            throws IOException %7B%0A        StringWriter stringWriter = new StringWriter();%0A        JsonGenerator jsonGenerator = new JsonFactory().createGenerator(stringWriter);%0A        TalkIds talkIds = new TalkIds();%0A        talkIds.add(talkIdList);%0A        talkIdsSerializer.serialize(talkIds, jsonGenerator, null);%0A        jsonGenerator.flush();%0A        jsonGenerator.close();%0A        stringWriter.close();%0A        return stringWriter.toString();%0A    %7D%0A%0A%7D%0A%0A

Test custom TalkIdsSerializer.