@Test
    public void shouldRemoveRefreshTraversalCache() {
        final Parameters parameters = new Parameters();
        parameters.set(null, "a", "axe", "b", "bat", "c", "cat", "c", mock(Traversal.Admin.class), "t", mock(Traversal.Admin.class));

        final Map<Object,List<Object>> before = parameters.getRaw();
        assertEquals(4, before.size());
        assertEquals(2, parameters.getTraversals().size());
        assertEquals("axe", before.get("a").get(0));
        assertEquals("bat", before.get("b").get(0));
        assertEquals("cat", before.get("c").get(0));
        assertThat(before.get("c").get(1), instanceOf(Traversal.Admin.class));
        assertThat(before.get("t").get(0), instanceOf(Traversal.Admin.class));

        parameters.remove("t");

        final Map<Object,List<Object>> afterRemoveT = parameters.getRaw();
        assertEquals(3, afterRemoveT.size());
        assertEquals(1, parameters.getTraversals().size());
        assertEquals("axe", afterRemoveT.get("a").get(0));
        assertEquals("bat", afterRemoveT.get("b").get(0));
        assertEquals("cat", afterRemoveT.get("c").get(0));
        assertThat(afterRemoveT.get("c").get(1), instanceOf(Traversal.Admin.class));

        parameters.remove("c");

        final Map<Object,List<Object>> afterRemoveC = parameters.getRaw();
        assertEquals(2, afterRemoveC.size());
        assertEquals(0, parameters.getTraversals().size());
        assertEquals("axe", afterRemoveC.get("a").get(0));
        assertEquals("bat", afterRemoveC.get("b").get(0));
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ParametersTest.java