title: Check if an array of objects with a specific property - java
body: <p>I have an array list full of objects, i want to check if there are any objects with the name property equal to &quot;maths&quot;.</p>
  <p>How can this be done?</p>
  <pre><code>if(courses.contains(students.get(i).chosenPathway)){
  </code></pre>
  <p>Right now im using this but it doesnt work as courses is an array list of objects</p>