title: What is the purpose of Objects#requireNonNull
body: <p>After checking the <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Objects.html#requireNonNull%28T%29">JavaDocs</a> for a method I was thinking of using, <code>requiredNonNull</code>, I stumbled across the first one with the single parameter <code>(T obj)</code>.</p>
  
  <p>However what is the actual purpose of this particular method with this signature? All it simply does is throw and NPE which I'm somewhat positive <em>(as a I may be missing something obvious here)</em> would be thrown anyway.</p>
  
  <blockquote>
    <p>Throws:
        <em>NullPointerException - if obj is null</em></p>
  </blockquote>
  
  <hr>
  
  <p>The latter actually makes sense in terms of debugging certain code, as the doc also states, it's primarily designed for parameter validation</p>
  
  <p><code>public static &lt;T&gt; T requireNonNull(T obj,String message)</code></p>
  
  <blockquote>
    <p>Checks that the specified object reference is not null and throws a customized NullPointerException if it is.</p>
  </blockquote>
  
  <p>Therefore I can print specific information along with the NPE to make debugging a hell of a lot easier.</p>
  
  <hr>
  
  <p>With this in mind I highly doubt I would come across a situation where I'd rather just use the former instead. Please do enlighten me.</p>
  
  <p>tl;dr - Why would you ever use the overload which doesn't take a message.</p>