@Test
    public void testListIndexerSerializationDeserializationRoundTrip() {
        // serialization and deserialization should not throw exception
        byte[] serialized = SerializationUtils.serialize(__.index().with(WithOptions.indexer, WithOptions.list));
        Object deserialized = SerializationUtils.deserialize(serialized);

        DefaultTraversal<Object, Object> gtr = (DefaultTraversal<Object, Object>) deserialized;
        assertEquals(1, gtr.getSteps().size());
        IndexStep<Object, Object> step = (IndexStep<Object, Object>) gtr.getSteps().get(0);
        assertEquals(IndexStep.IndexerType.LIST, step.getIndexerType());
        assertTrue(step.getIndexer() instanceof IndexStep.ListIndexFunction);
    }
@author Daniel Kuppitz (http://gremlin.guru)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/IndexStepTest.java