title: How to check if a list contains a sublist in a given order in Java
body: <p>I read in groovy  <a href="https://stackoverflow.com/questions/1871372/how-to-check-if-a-list-contains-a-sublist">how to check if a list contains a sublist - stackoverflow</a> . </p>
  
  <p>I am interested if there is a way of checking whether list contains sublist, but in a given order. For example, this code will give <strong>true</strong>,</p>
  
  <pre><code>    List&lt;String&gt; list = Arrays.asList("PRP", "VBP", "VBN", "NN", "NNS", "MD", "VB");
      List&lt;String&gt; sublist = Arrays.asList("MD", "VB", "VBN");
      System.out.println(list.containsAll(sublist));
  </code></pre>
  
  <p>But I want to get <strong>false</strong> back. </p>