Testing with dynamic_cast