title: Unboxing Null-Object to primitive type results in NullPointerException, fine?
body: <p>This snippet throws an <code>NullPointerException</code> due to the fact that its unboxed to a primitive type and <code>Long.longValue()</code> is called, right?</p>
  
  <p>Thats even easy to see if you have a snippet like this:</p>
  
  <pre><code>long value = (Long) null;
  </code></pre>
  
  <p>But the <code>NullPointerException</code> is even harder to get in a more complex situation like this:</p>
  
  <pre><code>long propertyValue = (Long) obj.getProperty(propertyModel.getName());
  </code></pre>
  
  <p>So isn't there any possibility for the Java-Compiler to make a more comfortable Exception out of this? I would prefer an <code>IllegalArgumentException</code> with a message like <em>"You're trying to cast a null-Object into a primitive type, this can't be done!"</em></p>
  
  <p>Wouldn't this be more appropriate? What do you think? Is this even possible at runtime? Are we able to determine this cast? I haven't yet looked at the java bytecode. Maybe it could be used in a solution.</p>
  
  <p><strong>This question can be answered</strong>: I'd like to know if it's possible to achieve this behaviour!</p>