@Override
        public void serialize(final ToyPoint toyPoint, final JsonGenerator jsonGenerator,
                              final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
            jsonGenerator.writeStartObject();
            jsonGenerator.writeObjectField("x", toyPoint.x);
            jsonGenerator.writeObjectField("y", toyPoint.y);
            jsonGenerator.writeEndObject();
        }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyPoint.java