public Tree shallowClone(){
  ArrayList<Tree> newChildren=new ArrayList<>(children.size());
  for (  Tree child : children) {
    newChildren.add(child.shallowClone());
  }
  Tree newTree=new Tree(label,newChildren);
  newTree.setIsTerminal(isTerminal());
  newTree.setBoundary(isBoundary());
  return newTree;
}

public Tree shallowClone ( ) { ArrayList < Tree > newChildren = new ArrayList < > ( children . size ( ) ) ; for ( Tree child : children ) { newChildren . add ( child . shallowClone ( ) ) ; } Tree newTree = new Tree ( label , newChildren ) ; newTree . setIsTerminal ( isTerminal ( ) ) ; newTree . setBoundary ( isBoundary ( ) ) ; return newTree ; }
clone the structure of the tree .
