I am using dependency injection to inject an implementation of an interface. I would like to make it possible to call a method on the injected type with a parameter whose implementation is also being injected and based on an Interface.
Example:  
- SessionInterfaceis implemented by- Session_Aand- Session_B
- ConfigInterfaceis implemented by- Config_Aand- Config_B
- Session_Ashould only use objects of- Config_A, same with- _B
In the application an implementation of a session is injected (without a config). Later, an implementation of config can be injected, to use it as a parameter for the session's method run(ConfigInterface config)
In this method I'd like to make sure that the given parameter's type is the one corresponding to the session.   
Should I use getClass(), instanceof or something else to check this? 
 
    