title: Eliminating or avoiding adding duplicates in a ArrayList with custom Object
body: <p>I have a custom object in this structure</p>
  
  <pre><code>static class Node {
      int col;
      int row;
      int g;
      int h;
      int f;
  
      public Node(int col, int row, int g, int h) {
          this.col = col;
          this.row = row;
          this.g = g;
          this.h = h;
          this.f = g+h;
      }
  }
  </code></pre>
  
  <p>The <code>col</code> and <code>row</code> variables are unique, and may only occur once in <code>ArrayList&lt;Node&gt; myList</code>.</p>
  
  <p>Is there a way optimal way to avoid adding or checking for possible duplicate without having to make a nasty for-loop?</p>
  
  <p>I am aware that <code>Set</code> interface possibly could be a solution for this as duplicates cannot occur, but i have alot of code right now, which i do not want to refactor unless it becomes necessary.</p>