title: Predicate Searching in Java
body: <p>Not quite sure how to word this question.
  I am wondering if there is a method to check certain parts of a custom java class to see if it matches a certain criteria. 
  Such as this</p>
  
  <pre><code>public Name(String forename, String middlename, String surname)
  </code></pre>
  
  <p>And then when an array of instances of that class are created say,</p>
  
  <pre><code>Name[] applicants = new Name[4];
  
  applicants[0] = new Name("john","bob", "rush");
  applicants[1] = new Name("joe","bob", "rushden");
  applicants[2] = new Name("jack","bob", "rushden");
  applicants[3] = new Name("jake","bob", "rushden");
  </code></pre>
  
  <p>Is it possible to do a search over the instances of the class for person with </p>
  
  <pre><code>midddlename.equals("bob") &amp;&amp; surname.equals("rush")
  </code></pre>
  
  <p>I am not really looking for a solution that is <code>if(surname.equals("bob")) then else</code>,etc</p>
  
  <p>But more a in-built java class that allows for rapid searching over the array.
  the speed of this is very important.</p>