This method is here for backwards compatibility only.
The key parameter is an Object but can only be a String.