title: Populating HashTable with ArrayList as a value
body: <p>I am having problems with creating HashTable in my program, I am creating WordLadder game.
  Basically I want my HashTable to contain key which is unique word and value would be words which are one letter difference. Problem is that when I print out to check what I am putting into it, it prints perfectly what I want, however when I return HashTable it returns me nonsense. </p>
  
  <p>My code for generating HashTable is following:</p>
  
  <pre><code>public Hashtable&lt;String, ArrayList&lt;String&gt;&gt; findNeighbors(){
        Hashtable&lt;String, ArrayList&lt;String&gt;&gt; data = new Hashtable&lt;String, ArrayList&lt;String&gt;&gt;();
        ArrayList&lt;String&gt; neighb = new ArrayList&lt;String&gt;();
        for(int i=0; i &lt; 5; i++){
         for(int j=0; j &lt; 5; j++){
          if (isNeighbor(words.get(i), words.get(j))) {
           neighb.add(words.get(j));
          }
         }
         data.put(words.get(i), neighb);
         //System.out.println(words.get(i)+ " "+data.get(words.get(i))); &lt;This Works perfectly fine
         System.out.println(data.toString()); //&lt;This returns nonsense
         neighb.clear();
        }
  
        return data;
       }
  
  public boolean isNeighbor(String a, String b){
        int diff = 0;
        for (int i = 0; i &lt; a.length(); i++){
         if(a.charAt(i) != b.charAt(i)){
          diff++;
         }
        }
        return diff==1;
       }
  </code></pre>