public void tryClearGraphs(){
            for(Pair<Graph, Configuration> p : openGraphs) {
                try {
                    innerGraphProvider.clear(p.getValue0(), p.getValue1());
                }catch (Exception e){
                    logger.warn(String.format("Automatic close of Graph instance [%s] and config [%s] generated failure.",
                            p.getValue0() != null ? p.getValue0().toString() : "null",
                            p.getValue1() != null ? p.getValue1().toString() : "null"), e);
                }
            }
        }
This class provides a way to intercepts calls to {@link Graph} implementation's {@link GraphProvider} instances.
When {@link #openTestGraph(Configuration)} is called the created object is stored in a list and when tests are
complete the {@link #tryClearGraphs()} is called. When this is called, an attempt is made to close all open graphs.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphManager.java