title: Check ArrayList content with Java stream
body: <p>Consider following ArrayList:</p>
  
  <pre><code>[0] =&gt; Person
  [1] =&gt; User
  [2] =&gt; Dummy
  </code></pre>
  
  <p>How can one with Java streams check if this arraylist contains any other objects than <code>Person</code> or <code>User</code> ?</p>
  
  <p>So that I can make an if statement to return null if it contains <strong>only</strong> <code>Person</code> and <code>User</code>, or return the arraylist itself if it contains any other objects besides <code>Person</code> or <code>User</code> like so:</p>
  
  <pre><code>if( /*arrayList contains only Person and User*/ ) {
    return null;
  }
  else {
    //arrayList contains other objects besides Person and User
    return arrayList;
  }
  </code></pre>