title: In Java, can I make a predicate that applies a filter on more than one object?
body: <p>I have a predicate that I use to filter a list of the same Entity Object:</p>
  
  <pre><code>Predicate&lt;DWHDeal&gt; companyFilter = i -&gt; i.getCompany().equals(company);
  </code></pre>
  
  <p>I also have to apply the same filter, with the exact same condition on the exact same field, on a list of DTOs where the DTOS is built based on the entity from before:</p>
  
  <pre><code>Predicate&lt;DWHDealDTO&gt; companyFilterDTO = i -&gt; i.getCompany().equals(company);
  </code></pre>
  
  <p>Is it possible to achieve this without instancing two different predicates? If possible, I would like to achieve this by making only one <code>Predicate</code>.</p>