title: add() method in Set implementation in Java does not work
body: <p>I am trying to implement my own <code>Set</code> with an ArrayList in Java. I am testing the <code>add()</code> method and somehow it wont add the elements in the Set. I know that if an element is added in the ArrayList then <code>List.add(input)</code> will return true, so maybe the problem lies there. Can someone help me understand what I am doing wrong?
  This is the implementation of the Set <code>add()</code>method:</p>
  
  <p>import java.util.ArrayList;
  import java.util.Collection;</p>
  
  <pre><code>public class Set&lt;E&gt; implements Collection&lt;E&gt; {
      private ArrayList&lt;E&gt; List = new ArrayList&lt;&gt;();
  
      public boolean add(E input) {
          if (contains(input)) {
              return false;
          }
          return List.add(input);
      }
  </code></pre>
  
  <p>And this is the test method I run :</p>
  
  <pre><code>import java.util.*;
  
  public class TestSet {
  
      public static Set&lt;Integer&gt; set = new Set&lt;Integer&gt;();
  
      public static void main(String[] args) {
          System.out.println("Enter a set :");
          Scanner userInput = new Scanner(System.in);
          set = new Set&lt;Integer&gt;();
  
          set.add(userInput.nextInt());
          System.out.println(set);
      }  
  </code></pre>
  
  <p>The output I get on the console after running the method is:</p>
  
  <pre><code>Enter a set :
  1
  Set@677327b6
  </code></pre>