title: Not annotated method overrides method annotated with @NotNull
body: <p>I'm implementing a custom data structure that gives me some properties of sets and other properties of lists. For most of the implemented methods though, I get this weird warning in IntelliJ IDEA on Java 7:</p>
  
  <blockquote>
    <p>Not annotated method overrides method annotated with @NotNull</p>
  </blockquote>
  
  <p><strong>EDIT</strong>: The code below isn't relevant to the issue, but part of the original question. This warning shows up because of a bug in IntelliJ. See the <a href="https://stackoverflow.com/a/27942889/1827734">answer</a> to (hopefully) resolve your issue.</p>
  
  <hr>
  
  <p>I haven't been able to find anything relevant about it and I'm not sure if I'm actually missing some sort of check, but I've looked through the source of both ArrayList and the List interface and can't see what this warning is actually about. It's on every implemented method that references the list field. Here's a snippet of the class I've made:</p>
  
  <pre><code>public class ListHashSet&lt;T&gt; implements List&lt;T&gt;, Set&lt;T&gt; {
  private ArrayList&lt;T&gt; list;
  private HashSet&lt;T&gt; set;
  
  
  /**
   * Constructs a new, empty list hash set with the specified initial
   * capacity and load factor.
   *
   * @param      initialCapacity the initial capacity of the list hash set
   * @param      loadFactor      the load factor of the list hash set
   * @throws     IllegalArgumentException  if the initial capacity is less
   *               than zero, or if the load factor is nonpositive
   */
  public ListHashSet(int initialCapacity, float loadFactor) {
      set = new HashSet&lt;&gt;(initialCapacity, loadFactor);
      list = new ArrayList&lt;&gt;(initialCapacity);
  }
  ...
  /**
   * The Object array representation of this collection
   * @return an Object array in insertion order
   */
  @Override
  public Object[] toArray() {  // warning is on this line for the toArray() method
      return list.toArray();
  }
  </code></pre>
  
  <p>EDIT: I have these additional constructors in the class:</p>
  
  <pre><code>public ListHashSet(int initialCapacity) {
      this(initialCapacity, .75f);
  }
  
  public ListHashSet() {
      this(16, .75f);
  }
  </code></pre>