title: Android @NonNull usefulness
body: <p>After a few reading and questions <a href="https://stackoverflow.com/questions/32652402/right-way-to-use-the-nonnull-annotation-in-android-studio">like this one</a> I was wondering if there was a point in using <code>@NonNull</code> Android Support Annotation.</p>
  <p>I can see a very small warning from Android Studio if I attempt to call a method with a <strong>null</strong> parameter that is annotated as <strong>@NonNull</strong>. Just a warning??</p>
  <p>What about Unit Testing ? <strong>Should I test the method with a null paramter?</strong> If I do ... I will get a <code>NullPointerException</code> and my test <strong>will fail</strong>.</p>
  <p>Let's say we are two developers. One working on the API and one testing the API in all kind of manners.
  As the second developer, it's my responsibility to test everything so that the API is bullet-proof. That's the whole point of Unit Testing, right ?</p>
  <p>So then ... what's the point of the first developer using @NonNull ?</p>
  <p>If someone else were to use this API with a null parameter ... then the API would throw a <strong>NPE</strong>. He then would think : &quot;Urg, that API sucks... NPE !&quot; and he would be right. That naughty dev for not checking if the parameter he sent is null or not should be faced with an <strong>IllegalArgumentException</strong> because it's his fault not that of the API's!</p>
  <p>Am I wrong ?</p>
  <p>I thought these annotations would enforce the compiler to show errors like <code>attempting to call methodName(@NonNull Object object) with null parameter</code>.</p>
  <h2>Update 1</h2>
  <p>Alright thank you all for your comments. I'd like to summ up if possible regarding the &quot;issue&quot; I am facing here. In an abstract way.</p>
  <p>I write some code (an API, a Library, a Class, whatever) with private internal code wrapped by public methods that provides features.</p>
  <p>Assume these public methods will be used by anyone else (including me).
  Some of them take arguments that must never be <strong>null</strong> or else all hell breaks loose.</p>
  <p>Reading your comments, I am facing the following options :</p>
  <ol>
  <li>Keep on using contracts / annotations (<code>@NonNull</code>) supported by Java Documentation stipulating <code>parameter must not be null</code>. Don't check for null parameters (or else IDE will warn me) and, somehow, pray that I will never receive a null parameter ;</li>
  <li>Same as above, but enforce a null check (even though IDE will warn that <code>condition will always be false</code>) and throw <code>IllegalArgumentException</code> instead of causing an NPE in case I receive a null parameter ;</li>
  <li>Stop using contracts / annotations, use Java Doc to warn others dev and add manual check for all parameters.</li>
  </ol>
  <p>Finally, for unit testing ... I know I can not have bullet-proof code, but I like to &quot;monkey-test&quot; my code as much as possible to prevent unexpected behavior from my code as well to validate the process (which is at the base of Unit Testing, I believe)-</p>