title: Check if list contains any item of another list in java
body: <p>We have two lists one is of type <code>Question</code> and the other of type <code>Tag</code>.</p>
  
  <p>The Question class has those attributes</p>
  
  <pre><code>private String id;
  private String header;
  private String content;
  private List&lt;Tag&gt; tags;
  private Long timeStamp;
  </code></pre>
  
  <p>The Question list has several questions in it and the Tag list has all tags in it.
  We wanna check if One question contains any tag of the tag list.
  I want to do this for all questions.</p>
  
  <p>With <code>question.getTags</code>, I get the list of tags.</p>
  
  <p>I tried</p>
  
  <pre><code>List&lt;Question&gt; allQuestions =  ... ; // List of type questions
  List&lt;Tags&gt; alltags = ... ;  // List of type tag
  
  for(Question question: allQuestions) {
      for(Tag tag: allTags){
          if(question.getTags().contains(tag)) {
              //do something
          }
      }
  }
  </code></pre>
  
  <p>This is not quite doing what I want to do, I think I have to do something with streams but I could not quite figure out how I exactly have to write the code.</p>