If you have control over the classes you'll be working with, have them all instantiate an interface that contains the methods you'll be calling and once you instantiate, cast to the interface.
I also posted an answer to your previous question with the same idea.