it tests for leaf node