title: How to move nodes in java linked simple list?
body: <p>I have the following problem with a simple java linked list. Which consists of exchanging <code>nodes</code>, here the code:</p>
  
  <pre><code>    private void swapNodo(Nodo&lt;T&gt; smaller, Nodo&lt;T&gt; current) {
      Nodo&lt;T&gt; previous =this.cab;
      while(previous.getSig()!=current){
          previous=previous.getSig();
      }
      Nodo&lt;T&gt; tmp=previous.getSig();
      current.setSig(smaller.getSig());
      previous.setSig(previous.getSig());
      smaller.setSig(tmp);
  }
  </code></pre>
  
  <p>That is why I attached the following image, so that you can understand what I want with that method.
  <a href="https://i.stack.imgur.com/byG7l.jpg" rel="nofollow noreferrer">Explanation</a></p>
  
  <p>To clarify, the exchange only has to be done with <code>nodes</code>, that is, their references are nothing more. Since changing the infos I already did it.</p>
  
  <p>I hope someone can help me doing the movement between nodes, thank you very much.</p>