title: Preconditions library to throw IllegalArgumentException for notNull check
body: <p>Do you know some nice alternative to <a href="https://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/Validate.html" rel="nofollow noreferrer">Apache Commons Validate</a> or <a href="https://code.google.com/p/guava-libraries/wiki/PreconditionsExplained" rel="nofollow noreferrer">Guava Preconditions</a> that would throw IllegalArgumentException instead of NullPointerException when checking if object is <em>not null</em> (except <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/Assert.html#notNull-java.lang.Object-" rel="nofollow noreferrer">Spring Assert</a>)?</p>
  
  <hr>
  
  <p>I'm aware that <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" rel="nofollow noreferrer">Javadocs</a> say:</p>
  
  <blockquote>
    <p>Applications should throw instances of this class [NullPointerException] to indicate other
    illegal uses of the null object.</p>
  </blockquote>
  
  <p>Nevertheless, I just don't like it. For me NPE was always meaning I just forgot to secure null reference somewhere. My eyes are so trained, I could spot it browsing logs with a speed of few pages per second and if I do there is always bug alert in my head enabled. Therefore, it would be quite confusing for me to have it thrown where I expect an IllegalArgumentException.</p>
  
  <p>Say I have a bean:</p>
  
  <pre><code>public class Person {
    private String name;
    private String phone;
    //....
  }
  </code></pre>
  
  <p>and a service method:</p>
  
  <pre><code>public void call(Person person) {
    //assert person.getPhone() != null
    //....
  }
  </code></pre>
  
  <p>In some context it may be ok, that a person has no phone (my grandma doesn't own any). But if you'd like to call such person, for me it's calling the <em>call</em> method with an <strong>IllegalArgument</strong> passed. Look at the hierarchy - NullPointerException is not even a subclass of IllegalArgumentException. It basically tells you - <em>Again you tried to call a getter on null reference</em>.</p>
  
  <p>Besides, there were discussions already and there is <a href="https://stackoverflow.com/a/3323006/1937263">this</a> nice answer I fully support. So my question is just - do I need to do ugly things like this:</p>
  
  <pre><code>Validate.isTrue(person.getPhone() != null, "Can't call a person that hasn't got a phone");
  </code></pre>
  
  <p>to have it my way, or is there a library that would just throw IllegalArgumentException for a notNull check?</p>