@Setup
    public void prepare() throws IOException {
        graph = TinkerGraph.open();
        g = graph.traversal();

        final LoadGraphWith[] loadGraphWiths = this.getClass().getAnnotationsByType(LoadGraphWith.class);
        final LoadGraphWith loadGraphWith = loadGraphWiths.length == 0 ? null : loadGraphWiths[0];
        final LoadGraphWith.GraphData loadGraphWithData = null == loadGraphWith ? null : loadGraphWith.value();

        String graphFile;
        if(loadGraphWithData != null) {
            if (loadGraphWithData.equals(LoadGraphWith.GraphData.GRATEFUL)) {
                graphFile = "grateful-dead-v3.kryo";
            } else if (loadGraphWithData.equals(LoadGraphWith.GraphData.MODERN)) {
                graphFile = "tinkerpop-modern-v3.kryo";
            } else if (loadGraphWithData.equals(LoadGraphWith.GraphData.CLASSIC)) {
                graphFile = "tinkerpop-classic-v3.kryo";
            } else if (loadGraphWithData.equals(LoadGraphWith.GraphData.CREW)) {
                graphFile = "tinkerpop-crew-v3.kryo";
            } else {
                throw new RuntimeException("Could not load graph with " + loadGraphWithData);
            }

            final GraphReader reader = GryoReader.build().create();
            try (final InputStream stream = AbstractGraphBenchmark.class.
                    getResourceAsStream(PATH + graphFile)) {
                reader.readGraph(stream, graph);
            }
        }
    }
Opens a new {@link TinkerGraph} instance and optionally preloads it with one of the test data sets enumerated
in {@link LoadGraphWith}.

@throws IOException on failure to load graph
gremlin-tools/gremlin-benchmark/src/main/java/org/apache/tinkerpop/benchmark/util/AbstractGraphBenchmark.java