private void addClearFocusNodeToBranch(List<OptionScanNode> branchNodes,ClearFocusNode clearFocusNode){
  if (branchNodes.size() < mDegree) {
    branchNodes.add(clearFocusNode);
  }
 else {
    OptionScanNode nodeWithClearFocus=branchNodes.get(branchNodes.size() - 1);
    branchNodes.remove(nodeWithClearFocus);
    nodeWithClearFocus=new OptionScanSelectionNode(nodeWithClearFocus,clearFocusNode);
    branchNodes.add(nodeWithClearFocus);
  }
}

private void addClearFocusNodeToBranch ( List < OptionScanNode > branchNodes , ClearFocusNode clearFocusNode ) { if ( branchNodes . size ( ) < mDegree ) { branchNodes . add ( clearFocusNode ) ; } else { OptionScanNode nodeWithClearFocus = branchNodes . get ( branchNodes . size ( ) - 1 ) ; branchNodes . remove ( nodeWithClearFocus ) ; nodeWithClearFocus = new OptionScanSelectionNode ( nodeWithClearFocus , clearFocusNode ) ; branchNodes . add ( nodeWithClearFocus ) ; } }
it adds the clearfocusnode to the list . if the list contains mdegree children , it creates a new branch adding the last child and a clearfocusnode . this way the number of children remains the same . if on the other hand , the list contains less than mdegree children , it simply adds the clearfocusnode as another child .
