The $provider might be concrete object implementing ServiceProviderInterface or string representing the className.
In both situations ServiceRegister will look up for already registered Provider of the same class and unregister
it.
InvalidArgumentException is thrown if invalid Provider object or class was passed.
ResourceUndefinedException is thrown if Provider of given class was not found.