private void assertWrongType(QueryProfile profile,String typeName,String name,Object value) {
        try {
            profile.set(name,value, registry);
            fail("Should fail setting " + name + " to " + value);
        }
        catch (IllegalArgumentException e) {
            assertEquals("Could not set '" + name + "' to '" + value + "': '" + value + "' is not a " + typeName,
                         Exceptions.toMessageString(e));
        }
    }
Tests overriding a subprofile as an id string through the query.
Here, no user profile is set before it is assigned in the query
The whole thing is accessed through a two levels of nontyped top-level profiles
container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java