private void writeProperties(final Edge edge, final JsonGenerator jsonGenerator) throws IOException {
            final Iterator<Property<Object>> elementProperties = normalize ?
                    IteratorUtils.list(edge.properties(), Comparators.PROPERTY_COMPARATOR).iterator() : edge.properties();
            if (elementProperties.hasNext()) {
                jsonGenerator.writeFieldName(GraphSONTokens.PROPERTIES);

                jsonGenerator.writeStartObject();
                if (typeInfo == TypeInfo.NO_TYPES)
                    elementProperties.forEachRemaining(prop -> safeWriteObjectField(jsonGenerator, prop.key(), prop.value()));
                else
                    elementProperties.forEachRemaining(prop -> safeWriteObjectField(jsonGenerator, prop.key(), prop));
                jsonGenerator.writeEndObject();
            }
        }
GraphSON serializers for graph-based objects such as vertices, edges, properties, and paths. These serializers
present a generalized way to serialize the implementations of core interfaces.

@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3.java