title: Compare two arraylists in java which have partial common values
body: <p>I have one array list having values as:</p>
  
  <blockquote>
    <p>IT Infrastructure<br>
     Teams<br>
     Wave Analytics Starter Kit<br>
     Blog Post<br>
     Case Studies<br>
     InfoGraphics<br>
     Grazitti Site Development-Revamp</p>
  </blockquote>
  
  <p>and another array list having values as:</p>
  
  <blockquote>
    <p>Wave Analytics Starter Kit56:00:00<br> IT Infrastructure01:00:00<br>
    Teams08:00:00<br> Blog Post21:30:00<br> Case Studies02:30:00<br>
    InfoGraphics02:45:00<br> Grazitti Site Development-Revamp11:00:00<br>
    Content Marketing03:00:00<br> Off-Page Content04:30:00<br>
    SMM05:00:00<br> Guest Blog01:30:00<br> LiNC 1600:30:00<br> Alteryx
    Inspire Conference 201625:30:00<br> PPC02:00:00<br>
    Training13:45:00<br></p>
  </blockquote>
  
  <p>Can I compare them to get the output as:</p>
  
  <blockquote>
    <p>IT Infrastructure01:00:00<br> Teams08:00:00<br> Wave Analytics Starter
    Kit56:00:00<br> Blog Post21:30:00<br> Case Studies02:30:00<br>
    InfoGraphics02:45:00<br> Grazitti Site Development-Revamp11:00:00<br></p>
  </blockquote>
  
  <p>The following piece of code isn't giving the desired ouput:</p>
  
  <pre><code>for(int c =0; c&lt;extractedvalue.size(); c++){
  System.out.println(extractedvalue.get(c));
             if (extractedvalue.contains(hoursplusprojects.get(c))){
                 System.out.println(hoursplusprojects.get(c));
             }
  </code></pre>