@Override
    protected Statement withAfterClasses(final Statement statement) {
        final Statement wrappedStatement = new Statement() {
            @Override
            public void evaluate() throws Throwable {
                statement.evaluate();

                // release resources in GraphProviders that implement AutoCloseable
                final GraphProvider gp = GraphManager.getGraphProvider();
                if (gp instanceof AutoCloseable)
                    ((AutoCloseable) gp).close();
            }
        };

        return super.withAfterClasses(wrappedStatement);
    }
Filter a list of test classes through the GREMLIN_TESTS environment variable list.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java