public static boolean parentContainsOnlyLeaves ( ParentNode parentNode ) { for ( Node child : parentNode . children ( ) ) { if ( ! isLeaf ( child ) ) return false ; } return true ; }
Determines if parent node has children that are all leaves