instanceof doesn't distinguish a class type from a interface, but I will use it, because I saw that reflection is not used at all in the existing code base.