Checking get_class in equals