@Test
    void testListVariantPropertiesCompounds2() {
        QueryProfile parent1 = new QueryProfile("parent1");
        parent1.set("p1.a", "parent1-a", null); // Defined everywhere
        parent1.set("p1.b", "parent1-b", null); // Defined everywhere, but no variants
        parent1.set("p1.c", "parent1-c", null); // Defined in both parents only

        QueryProfile parent2 = new QueryProfile("parent2");
        parent2.set("p1.a", "parent2-a", null);
        parent2.set("p1.b", "parent2-b", null);
        parent2.set("p1.c", "parent2-c", null);
        parent2.set("p1.d", "parent2-d", null); // Defined in second parent only

        QueryProfile main = new QueryProfile("main");
        main.setDimensions(new String[]{"x", "y"});
        main.addInherited(parent1);
        main.addInherited(parent2);
        main.set("p1.a", "main-a", null);
        main.set("p1.a", "main-a-x1", new String[]{"x1"}, null);
        main.set("p1.e", "main-e-x1", new String[]{"x1"}, null); // Defined in two variants only
        main.set("p1.f", "main-f-x1", new String[]{"x1"}, null); // Defined in one variants only
        main.set("p1.a", "main-a-x1.y1", new String[]{"x1", "y1"}, null);
        main.set("p1.a", "main-a-x1.y2", new String[]{"x1", "y2"}, null);
        main.set("p1.e", "main-e-x1.y2", new String[]{"x1", "y2"}, null);
        main.set("p1.g", "main-g-x1.y2", new String[]{"x1", "y2"}, null); // Defined in one variant only
        main.set("p1.b", "main-b", null);

        QueryProfile inheritedVariant1 = new QueryProfile("inheritedVariant1");
        inheritedVariant1.set("p1.a", "inheritedVariant1-a", null);
        inheritedVariant1.set("p1.h", "inheritedVariant1-h", null); // Only defined in two inherited variants

        QueryProfile inheritedVariant2 = new QueryProfile("inheritedVariant2");
        inheritedVariant2.set("p1.a", "inheritedVariant2-a", null);
        inheritedVariant2.set("p1.h", "inheritedVariant2-h", null); // Only defined in two inherited variants
        inheritedVariant2.set("p1.i", "inheritedVariant2-i", null); // Only defined in one inherited variant

        QueryProfile inheritedVariant3 = new QueryProfile("inheritedVariant3");
        inheritedVariant3.set("p1.j", "inheritedVariant3-j", null); // Only defined in one inherited variant, but inherited twice

        main.addInherited(inheritedVariant1, new String[]{"x1"});
        main.addInherited(inheritedVariant3, new String[]{"x1"});
        main.addInherited(inheritedVariant2, new String[]{"x1", "y2"});
        main.addInherited(inheritedVariant3, new String[]{"x1", "y2"});

        Properties properties = new QueryProfileProperties(main.compile(null));

        int expectedBaseSize = 4;

        // No context
        Map<String, Object> listed = properties.listProperties();
        assertEquals(expectedBaseSize, listed.size());
        assertEquals("main-a", listed.get("p1.a"));
        assertEquals("main-b", listed.get("p1.b"));
        assertEquals("parent1-c", listed.get("p1.c"));
        assertEquals("parent2-d", listed.get("p1.d"));

        // Context x=x1
        listed = properties.listProperties(toMap(main, new String[]{"x1"}));
        assertEquals(expectedBaseSize + 4, listed.size());
        assertEquals("main-a-x1", listed.get("p1.a"));
        assertEquals("main-b", listed.get("p1.b"));
        assertEquals("parent1-c", listed.get("p1.c"));
        assertEquals("parent2-d", listed.get("p1.d"));
        assertEquals("main-e-x1", listed.get("p1.e"));
        assertEquals("main-f-x1", listed.get("p1.f"));
        assertEquals("inheritedVariant1-h", listed.get("p1.h"));
        assertEquals("inheritedVariant3-j", listed.get("p1.j"));

        // Context x=x1,y=y1
        listed = properties.listProperties(toMap(main, new String[]{"x1", "y1"}));
        assertEquals(expectedBaseSize + 4, listed.size());
        assertEquals("main-a-x1.y1", listed.get("p1.a"));
        assertEquals("main-b", listed.get("p1.b"));
        assertEquals("parent1-c", listed.get("p1.c"));
        assertEquals("parent2-d", listed.get("p1.d"));
        assertEquals("main-e-x1", listed.get("p1.e"));
        assertEquals("main-f-x1", listed.get("p1.f"));
        assertEquals("inheritedVariant1-h", listed.get("p1.h"));
        assertEquals("inheritedVariant3-j", listed.get("p1.j"));

        // Context x=x1,y=y2
        listed = properties.listProperties(toMap(main, new String[]{"x1", "y2"}));
        assertEquals(expectedBaseSize + 6, listed.size());
        assertEquals("main-a-x1.y2", listed.get("p1.a"));
        assertEquals("main-b", listed.get("p1.b"));
        assertEquals("parent1-c", listed.get("p1.c"));
        assertEquals("parent2-d", listed.get("p1.d"));
        assertEquals("main-e-x1.y2", listed.get("p1.e"));
        assertEquals("main-f-x1", listed.get("p1.f"));
        assertEquals("main-g-x1.y2", listed.get("p1.g"));
        assertEquals("inheritedVariant2-h", listed.get("p1.h"));
        assertEquals("inheritedVariant2-i", listed.get("p1.i"));
        assertEquals("inheritedVariant3-j", listed.get("p1.j"));

        // Context x=x1,y=y3
        listed = properties.listProperties(toMap(main, new String[]{"x1", "y3"}));
        assertEquals(expectedBaseSize + 4, listed.size());
        assertEquals("main-a-x1", listed.get("p1.a"));
        assertEquals("main-b", listed.get("p1.b"));
        assertEquals("parent1-c", listed.get("p1.c"));
        assertEquals("parent2-d", listed.get("p1.d"));
        assertEquals("main-e-x1", listed.get("p1.e"));
        assertEquals("main-f-x1", listed.get("p1.f"));
        assertEquals("inheritedVariant1-h", listed.get("p1.h"));
        assertEquals("inheritedVariant3-j", listed.get("p1.j"));

        // Context x=x2,y=y1
        listed = properties.listProperties(toMap(main, new String[]{"x2", "y1"}));
        assertEquals(expectedBaseSize, listed.size());
        assertEquals("main-a", listed.get("p1.a"));
        assertEquals("main-b", listed.get("p1.b"));
        assertEquals("parent1-c", listed.get("p1.c"));
        assertEquals("parent2-d", listed.get("p1.d"));
    }
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