public void checkRemoveAndListMethods(final Storage storage, final String outputLocation) throws Exception {
        final String graphLocation = Constants.getGraphLocation(outputLocation);
        final String memoryLocation= Constants.getMemoryLocation(outputLocation, "clusterCount");
        final GraphComputer graphComputer = graphProvider.getGraphComputer(graph);

        graphComputer.program(PeerPressureVertexProgram.build().create(graph)).mapReduce(ClusterCountMapReduce.build().memoryKey("clusterCount").create()).submit().get();

        assertTrue("storage.exists(outputLocation)", storage.exists(outputLocation));
        assertTrue("storage.exists(graphLocation)", storage.exists(graphLocation));
        assertTrue("storage.exists(memoryLocation)", storage.exists(memoryLocation));

        assertEquals(2, storage.ls(outputLocation).size());

        assertTrue("storage.rm(graphLocation)", storage.rm(graphLocation));
        assertFalse("storage.rm(graphLocation)", storage.rm(graphLocation));
        assertFalse("storage.exists(graphLocation)", storage.exists(graphLocation));

        assertEquals(1, storage.ls(outputLocation).size());

        assertTrue("storage.rm(memoryLocation)", storage.rm(memoryLocation));
        assertFalse("storage.rm(memoryLocation)", storage.rm(memoryLocation));
        assertFalse("storage.exists(memoryLocation)", storage.exists(memoryLocation));

        assertEquals(0, storage.ls(outputLocation).size());

        storage.rm(outputLocation);

        assertFalse("storage.exists(outputLocation)", storage.exists(outputLocation));
        assertEquals(0, storage.ls(outputLocation).size());
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractStorageCheck.java