public static <T> T serializeDeserializeAuto(final ObjectMapper mapper, final Object o) throws Exception {
        try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
            mapper.writeValue(stream, o);

            try (final InputStream inputStream = new ByteArrayInputStream(stream.toByteArray())) {
                // Object.class is the wildcard that triggers the auto discovery.
                return (T)mapper.readValue(inputStream, Object.class);
            }
        }
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/AbstractGraphSONTest.java