If multiple types are possible, the method itself does not know the type to cast, but the caller does, you might use something like this:
void TheObliviousHelperMethod<T>(object obj) {
(T)obj.ThatClassMethodYouWantedToInvoke();
}
// Meanwhile, where the method is called:
TheObliviousHelperMethod<ActualType>(obj);
Restrictions on the type could be added using the where
keyword after the parentheses.