Registry class is a generic class that provides a registry functionality for any type of object.
It uses a Map to store the objects, where the key is a string and the value is of type T.
The key for each object is determined by a function passed to the constructor.