Aha, I see. In that case, it is preferable to modify the unit test (for the buttons to have a parent) to avoid having a conditional expression in the code that is otherwise not needed.