what about criteria objects here? when a `Criteria` is passed into this function it will return `null` because no explicit `return` is reached. I think we should throw a exception in case we cannot calc a key for the given `$value` because otherwise it will always be `null` and therefore override each other