@Test
    void testDeepCopy() {
        Item root1 = parseQuery("a and b and (c or d) and e rank f andnot g", null, Query.Type.ADVANCED);
        Item root2 = root1.clone();

        assertTrue(nonIdenticalTrees(root1, root2), "Item.clone() should be a deep copy.");
    }
Check copy of query trees is a deep copy
container-search/src/test/java/com/yahoo/prelude/query/test/QueryTestCase.java