code: private void swapINodes(List<INode> listOfNodes, int source, int target) {
          INode aux = listOfNodes.get(source);
          listOfNodes.set(source, listOfNodes.get(target));
          listOfNodes.set(target, aux);
      }
docs: Swaps the INodes in listOfNodes in the positions source and target.
  
  @param listOfNodes List of INodes of which the elements should be swapped.
  @param source      index of the source element to be swapped.
  @param target      index of the target element to be swapped.