@Test
    void testQueryProfileReferences() {
        QueryProfile main = new QueryProfile("main");
        main.setDimensions(new String[]{"x1"});
        QueryProfile referencedMain = new QueryProfile("referencedMain");
        referencedMain.set("r1", "mainReferenced-r1", null); // In both
        referencedMain.set("r2", "mainReferenced-r2", null); // Only in this
        QueryProfile referencedVariant = new QueryProfile("referencedVariant");
        referencedVariant.set("r1", "variantReferenced-r1", null); // In both
        referencedVariant.set("r3", "variantReferenced-r3", null); // Only in this

        main.set("a", referencedMain, null);
        main.set("a", referencedVariant, new String[]{"x1"}, null);

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

        // No context
        Map<String, Object> listed = properties.listProperties();
        assertEquals(2, listed.size());
        assertEquals("mainReferenced-r1", listed.get("a.r1"));
        assertEquals("mainReferenced-r2", listed.get("a.r2"));

        // Context x=x1
        listed = properties.listProperties(toMap(main, new String[]{"x1"}));
        assertEquals(3, listed.size());
        assertEquals("variantReferenced-r1", listed.get("a.r1"));
        assertEquals("mainReferenced-r2", listed.get("a.r2"));
        assertEquals("variantReferenced-r3", listed.get("a.r3"));
    }
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