class MapBackedRefResolver implements ReferenceResolver<NestableInput<?>> {

    private Map<ColumnIdent, NestableInput> implByColumn;

    public MapBackedRefResolver(Map<ColumnIdent, NestableInput> implByColumn) {
        this.implByColumn = implByColumn;
    }

    @Override
    public NestableInput getImplementation(Reference ref) {
        return lookupMapWithChildTraversal(implByColumn, ref.column());
    }

    static NestableInput lookupMapWithChildTraversal(Map<ColumnIdent, NestableInput> implByColumn, ColumnIdent column) {<FILL_FUNCTION_BODY>}
}

        if (column.isRoot()) {
            return implByColumn.get(column);
        }
        NestableInput<?> rootImpl = implByColumn.get(column.getRoot());
        if (rootImpl == null) {
            return implByColumn.get(column);
        }
        return NestableInput.getChildByPath(rootImpl, column.path());
    
<no_super_class>