title: JAVA: How to check if all in objects array are objects of a subclass?
body: <p>I got an array with Objects. Now I want to check if all of those Objects are instance of MyObject. </p>
  
  <p>Is there a <strong>better</strong> option <strong>than this</strong>:</p>
  
  <pre><code>boolean check = true;
  for (Object o : justAList){
    if (!(o instanceof MyObject)){
      check = false;
      break;
    }
  }
  </code></pre>