@Test
    void testVariantInheritance() {
        QueryProfile test = new QueryProfile("test");
        test.setDimensions(new String[]{"x", "y"});
        QueryProfile defaultParent = new QueryProfile("defaultParent");
        defaultParent.set("a", "a-default", null);
        QueryProfile x1Parent = new QueryProfile("x1Parent");
        x1Parent.set("a", "a-x1", null);
        x1Parent.set("d", "d-x1", null);
        x1Parent.set("e", "e-x1", null);
        QueryProfile x1y1Parent = new QueryProfile("x1y1Parent");
        x1y1Parent.set("a", "a-x1y1", null);
        QueryProfile x1y2Parent = new QueryProfile("x1y2Parent");
        x1y2Parent.set("a", "a-x1y2", null);
        x1y2Parent.set("b", "b-x1y2", null);
        x1y2Parent.set("c", "c-x1y2", null);
        test.addInherited(defaultParent);
        test.addInherited(x1Parent, new String[]{"x1"});
        test.addInherited(x1y1Parent, new String[]{"x1", "y1"});
        test.addInherited(x1y2Parent, new String[]{"x1", "y2"});
        test.set("c", "c-x1", new String[]{"x1"}, null);
        test.set("e", "e-x1y2", new String[]{"x1", "y2"}, null);

        CompiledQueryProfile ctest = test.compile(null);

        assertEquals("a-default", ctest.get("a"));
        assertEquals("a-x1", ctest.get("a", toMap("x=x1")));
        assertEquals("a-x1y1", ctest.get("a", toMap("x=x1", "y=y1")));
        assertEquals("a-x1y2", ctest.get("a", toMap("x=x1", "y=y2")));

        assertNull(ctest.get("b"));
        assertNull(ctest.get("b", toMap("x=x1")));
        assertNull(ctest.get("b", toMap("x=x1", "y=y1")));
        assertEquals("b-x1y2", ctest.get("b", toMap("x=x1", "y=y2")));

        assertNull(ctest.get("c"));
        assertEquals("c-x1", ctest.get("c", toMap("x=x1")));
        assertEquals("c-x1", ctest.get("c", toMap("x=x1", "y=y1")));
        assertEquals("c-x1y2", ctest.get("c", toMap("x=x1", "y=y2")));

        assertNull(ctest.get("d"));
        assertEquals("d-x1", ctest.get("d", toMap("x=x1")));

        assertEquals("d-x1", ctest.get("d", toMap("x=x1", "y=y1")));
        assertEquals("d-x1", ctest.get("d", toMap("x=x1", "y=y2")));

        assertNull(ctest.get("d"));
        assertEquals("e-x1", ctest.get("e", toMap("x=x1")));
        assertEquals("e-x1", ctest.get("e", toMap("x=x1", "y=y1")));
        assertEquals("e-x1y2", ctest.get("e", toMap("x=x1", "y=y2")));
    }
Tests referencing a variant which modifies the dimension set,
and also setting a value within that variants subspace.
container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileVariantsTestCase.java