@Test
    void testFreezing() {
        QueryProfile profile = new QueryProfile("test");
        profile.set("a", "a-value", null);
        profile.set("b.c", "b.c-value", null);
        profile.set("d.e.f", "d.e.f-value", null);

        assertFalse(profile.isFrozen());
        assertEquals("a-value", profile.get("a"));

        profile.freeze();

        assertTrue(profile.isFrozen());
        assertTrue(((QueryProfile) profile.lookup("b", null)).isFrozen());
        assertTrue(((QueryProfile) profile.lookup("d.e", null)).isFrozen());

        try {
            profile.set("a", "value", null);
            fail("Expected exception");
        }
        catch (IllegalStateException e) {
        }
    }
Tests cloning, with wrappers used in production in place
container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java