@Test
    void testListingSources() {
        QueryProfile p = new QueryProfile("test");
        p.set("a", "a-value", null);
        p.set("a.b", "a.b-value", null);

        {
            Map<String, ValueWithSource> values = p.compile(null).listValuesWithSources(CompoundName.empty, new HashMap<>(), null);
            assertEquals(2, values.size());
            assertEquals("a-value", values.get("a").value());
            assertEquals("test", values.get("a").source());
            assertEquals("a.b-value", values.get("a.b").value());
            assertEquals("test", values.get("a.b").source());
        }

        {
            Map<String, ValueWithSource> values = p.compile(null).listValuesWithSources(CompoundName.from("a"), new HashMap<>(), null);
            assertEquals(1, values.size());
            assertEquals("a.b-value", values.get("b").value());
            assertEquals("test", values.get("b").source());
        }
    }
Tests having both an explicit reference and an override
container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java