@Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
    public void shouldWriteVerticesToMultiplePartitions() {
        final PartitionStrategy partitionStrategyAA = PartitionStrategy.build()
                .partitionKey(partition).writePartition("A").readPartitions("A").create();
        final GraphTraversalSource sourceAA = g.withStrategies(partitionStrategyAA);

        final PartitionStrategy partitionStrategyBA = PartitionStrategy.build()
                .partitionKey(partition).writePartition("B").readPartitions("A").create();
        final GraphTraversalSource sourceBA = g.withStrategies(partitionStrategyBA);

        final PartitionStrategy partitionStrategyBB = PartitionStrategy.build()
                .partitionKey(partition).writePartition("B").readPartitions("B").create();
        final GraphTraversalSource sourceBB = g.withStrategies(partitionStrategyBB);

        final PartitionStrategy partitionStrategyBAB = PartitionStrategy.build()
                .partitionKey(partition).writePartition("B").readPartitions("A", "B").create();
        final GraphTraversalSource sourceBAB = g.withStrategies(partitionStrategyBAB);


        final Vertex vA = sourceAA.addV().property("any", "a").next();
        final Vertex vB = sourceBA.addV().property("any", "b").next();

        assertNotNull(vA);
        assertEquals("a", g.V(vA).values("any").next());
        assertEquals("A", g.V(vA).values(partition).next());

        assertNotNull(vB);
        assertEquals("b", g.V(vB).values("any").next());
        assertEquals("B", g.V(vB).values(partition).next());

        sourceBA.V().forEachRemaining(v -> assertEquals("a", g.V(v).values("any").next()));
        sourceBB.V().forEachRemaining(v -> assertEquals("b", g.V(v).values("any").next()));

        assertEquals(new Long(2), sourceBAB.V().count().next());
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java