A utility function to test above functions
static void test ( Node root , int k ) { Node nr = nextRightNodeUtil ( root , k ) ; if ( nr != null ) System . out . println ( " Next ▁ Right ▁ of ▁ " + k + " ▁ is ▁ " + nr . key ) ; else System . out . println ( " No ▁ next ▁ right ▁ node ▁ found ▁ for ▁ " + k ) ; }