title: Check if one list contains element from the other
body: <p>I have two lists with different objects in them.</p>
  
  <pre><code>List&lt;Object1&gt; list1;
  List&lt;Object2&gt; list2;
  </code></pre>
  
  <p>I want to check if element from list1 exists in list2, based on specific attribute (Object1 and Object2 have (among others),  one mutual attribute (with type Long), named attributeSame).</p>
  
  <p>right now, I do it like this:</p>
  
  <pre><code>boolean found = false;
  for(Object1 object1 : list1){
     for(Object2 object2: list2){
         if(object1.getAttributeSame() == object2.getAttributeSame()){
             found = true;
             //also do something
         }
      }
      if(!found){
          //do something
      }
      found = false;
  }
  </code></pre>
  
  <p>But I think there is a better and faster way to do this :)
  Can someone propose it?</p>
  
  <p>Thanks!</p>