title: Java: null pointer exception when unboxing Integer?
body: <p>This code is causing a null pointer exception. I have no idea why:</p>
  
  <pre><code>private void setSiblings(PhylogenyTree node, Color color) throws InvalidCellNumberException {
      PhylogenyTree parent = node.getParent();
  
      for (PhylogenyTree sibling : parent.getChildren()) {
          if (! sibling.equals(node)) {
              Animal animal = sibling.getAnimal();
              BiMap&lt;PhylogenyTree, Integer&gt; inverse = cellInfo.inverse();
              int cell = inverse.get(animal); // null pointer exception here
              setCellColor(cell, color);
          }
      }
  }
  </code></pre>
  
  <p>I've examined it in the debugger, and all the local variables are non-null. How else could this be happening? The BiMap is from Google Collections.</p>