title: java.lang.Boolean cannot be cast to java.util.LinkedList
body: <p>I have a <code>HashMap</code> where the key is of type <code>String</code> and the value is of type <code>LinkedList</code> of type <code>String</code>.</p>
  
  <p>So basically, here's what I'm trying to do.  </p>
  
  <pre><code>while (contentItr.hasNext()) {
      String word = (String) contentItr.next();
      if (wordIndex.containsKey(word)) {
          LinkedList temp = (LinkedList) w.get(word); //Error occurs here
          temp.addLast(currentUrl);
      } else {
          w.put(word, new LinkedList().add(currentUrl));
      }
  }
  </code></pre>
  
  <p>The first time that I add a key,value pair, I receive no error. However, when I try to retrieve the linked list associated with an existing key, I get the following exception: </p>
  
  <pre><code>java.lang.Boolean cannot be cast to java.util.LinkedList. 
  </code></pre>
  
  <p>I don't have a possible explanation of why this exception occurs. </p>