checking methods have the same return type