@Test
    void testInheritance2Level() {
        QueryProfile barn = new QueryProfile("barn");
        QueryProfile mor = new QueryProfile("mor");
        QueryProfile far = new QueryProfile("far");
        QueryProfile mormor = new QueryProfile("mormor");
        QueryProfile morfar = new QueryProfile("morfar");
        QueryProfile farfar = new QueryProfile("farfar");
        barn.addInherited(mor);
        barn.addInherited(far);
        mor.addInherited(mormor);
        mor.addInherited(morfar);
        far.addInherited(farfar);

        morfar.set("a.x", "morfar-a", null);
        mormor.set("a.x", "mormor-a", null);
        farfar.set("a.x", "farfar-a", null);
        mor.set("a.x", "mor-a", null);
        far.set("a.x", "far-a", null);
        barn.set("a.x", "barn-a", null);

        mormor.set("b.x", "mormor-b", null);
        far.set("b.x", "far-b", null);

        mor.set("c.x", "mor-c", null);
        far.set("c.x", "far-c", null);

        mor.set("d.a.x", "mor-d.a", null);
        barn.set("d.b.x", "barn-d.b", null);

        QueryProfile annetBarn = new QueryProfile("annetBarn");
        annetBarn.set("venn", barn, null);

        CompiledQueryProfile cbarn = barn.compile(null);
        CompiledQueryProfile cannetBarn = annetBarn.compile(null);

        assertEquals("barn-a", cbarn.get("a.x"));
        assertEquals("mormor-b", cbarn.get("b.x"));
        assertEquals("mor-c", cbarn.get("c.x"));

        assertEquals("barn-a", cannetBarn.get("venn.a.x"));
        assertEquals("mormor-b", cannetBarn.get("venn.b.x"));
        assertEquals("mor-c", cannetBarn.get("venn.c.x"));

        assertEquals("barn-d.b", cbarn.get("d.b.x"));
        assertEquals("mor-d.a", cbarn.get("d.a.x"));
    }
Tests cloning, with wrappers used in production in place
container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java