title: Remove duplicate node
body: <p>I am lost and really hope someone could help me out here, I am supposed to create a function that finds duplicated number nodes and delete the duplicates. Whenever I run the whole code I am stuck in an infinite loop inside <code>while(current.next != null)</code>.</p>
  
  <p>My main question is, I know my problem resides in <code>if (tester.data == current.data)</code>. I do not understand why they never test or compare (their ints). I am sorry if this is a vague question I have been staring at my screen baffled for hours. </p>
  
  <pre><code>public void removeDuplicate()
  {
      // removes all duplicate nodes from the list
  
      Node tester = head;
      Node previous = head;
      Node current = head.next;
  
      while (tester.next != null){
          int i = 0;
          while(current.next != null){
              System.out.println("Stuck here3");
              if (tester.data == current.data){
              Node tempNode = current.next;
                  previous.next = tempNode;
                  current = tempNode;
                  size--;
                  System.out.println("Stuck here2");
                  break;
                  }
  
              else{   
                  previous = current;
                  current = current.next;
              }
  
          }
          System.out.println("Stuck here1");
          tester = tester.next;
          current = tester.next;
      }
  
  }
  </code></pre>