When we check the condition. To make the code logic clearer, use successor.isParent to replace successor.getSuccessor.