public void serialize(Map<String, T> map, JsonGenerator jsonGenerator) throws IOException {
        jsonGenerator.writeStartObject();
        for (Map.Entry<String, T> entry : map.entrySet()) {
            jsonGenerator.writeFieldName(entry.getKey());
            if (entry.getValue() == null) {
                jsonGenerator.writeNull();
            } else {
                serialize(entry.getValue(), jsonGenerator, true);
            }
        }
        jsonGenerator.writeEndObject();
    }
Serialize a list of objects to a JsonGenerator.

@param map The map of objects to serialize.
@param jsonGenerator The JsonGenerator to which the list should be serialized
core/src/main/java/com/bluelinelabs/logansquare/JsonMapper.java