public static void serialize(final Object object, final Configuration configuration, final String key) {
        try {
            configuration.setProperty(key, Base64.getEncoder().encodeToString(Serializer.serializeObject(object)));
        } catch (final IOException e) {
            throw new IllegalArgumentException(e.getMessage(), e);
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java