@Test
    void testVariantReference() {
        QueryProfileRegistry registry = new QueryProfileRegistry();

        QueryProfile parent = new QueryProfile("parent");
        parent.set("b", 48, registry);
        registry.register(parent);

        QueryProfile referenced = new QueryProfile("referenced");
        referenced.addInherited(parent);
        referenced.setDimensions(new String[]{"d2", "d3"});
        registry.register(referenced);

        QueryProfile base = new QueryProfile("base");
        base.setDimensions(new String[]{"d1", "d2", "d3"});
        base.set("a", referenced, new String[]{null, null, "d3-val"}, registry);
        assertEquals("[d1, d2, d3]",
                ((QueryProfile) base.getVariants().getVariants().get(0).values().get("a")).getDimensions().toString(),
                "Variant dimensions are not overridden by the referenced dimensions");
        base.set("a.b", 1, new String[]{null, null, "d3-val"}, registry);
        QueryProfileVariant aVariants = base.getVariants().getVariants().get(0);
        assertEquals("[d1, d2, d3]",
                ((QueryProfile) aVariants.values().get("a")).getDimensions().toString(),
                "Variant dimensions are not overridden by the referenced dimensions");
    }
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