public static <V extends VertexProgram> V createVertexProgram(final Graph graph, final Configuration configuration) {
        try {
            final Class<V> vertexProgramClass = (Class) Class.forName(configuration.getString(VERTEX_PROGRAM));
            final Constructor<V> constructor = vertexProgramClass.getDeclaredConstructor();
            constructor.setAccessible(true);
            final V vertexProgram = constructor.newInstance();
            vertexProgram.loadState(graph, configuration);
            return vertexProgram;
        } catch (final Exception e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
A helper method to construct a {@link VertexProgram} given the content of the supplied configuration.
The class of the VertexProgram is read from the {@link VertexProgram#VERTEX_PROGRAM} static configuration key.
Once the VertexProgram is constructed, {@link VertexProgram#loadState} method is called with the provided graph and configuration.

@param graph         The graph that the vertex program will execute against
@param configuration A configuration with requisite information to build a vertex program
@param <V>           The vertex program type
@return the newly constructed vertex program
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java