@Test
    public void shouldCorrectlyInitializeTraversalParentCacheForDeeplyNestedWhereUnionSteps3() {
        // traversal
        final Traversal<?, ?> traversal = __.V().as("n").
                where(
                        where(
                                where(
                                        __.or(
                                                __.select("n").hasLabel("software1"),
                                                __.select("n").hasLabel("person1")
                                        )
                                ).
                                        union(
                                                __.select("n").hasLabel("software2"),
                                                __.select("n").hasLabel("person2")
                                        ).
                                        select("n").by("name")
                        ).
                                union(
                                        __.or(
                                                __.select("n").hasLabel("abc"),
                                                __.select("n").hasLabel("123")
                                        ),
                                        __.select("m").hasLabel("person")
                                ).
                                select("m").by("name")
                );

        // no cache entries/no expected order of traversal parents, so the method will just compare with old collection method
        doTest(traversal, Optional.empty(), Optional.empty());
    }
Testing whether the cache for the FilterRankingStrategy is correctly initialized,
which includes gathering/collecting the traversal parents and their children steps
in the correct deep first manner.
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyCacheInitializationTest.java