private void assertSameObjects(CompiledQueryProfile profile, String path, List<String> expectedKeys) {
        Map<String, Object> subObjects = profile.listValues(path);
        assertEquals(new HashSet<>(expectedKeys), subObjects.keySet(), "Sub-objects list equal for path " + path);
        for(String key : expectedKeys) {
            assertEquals(profile.get(key),subObjects.get(path + "." + key),"Equal for key " + key);
        }

    }
Tests cloning, with wrappers used in production in place
container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java