title: JAVA - Reading CSV file based on another CSV file
body: <p>I am struggling with making this work properly. So I have two CSV Files. 
  <a href="https://i.stack.imgur.com/MrpZr.png." rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MrpZr.png." alt="enter image description here"></a></p>
  
  <p>And this One</p>
  
  <p><a href="https://i.stack.imgur.com/g30Jj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g30Jj.png" alt="enter image description here"></a></p>
  
  <p>So the main thing is. I have SearchTerms in 2nd CSV. In first CSV I have SearchTerms also, which should work as a "tag". 
  What I need is to get product ids from first CSV saved to a List &lt; String > based on, what searchterm from 2nd csv is used. So when Akt (pan) is used, one set of List of IDS is exported. If there is more Akt (pan) sets of ids, they are saved to one list as array I guess.</p>
  
  <p>I tried to read it with CSVloaders and searching it with lookup() method</p>
  
  <pre><code>private final Map&lt;List&lt;String&gt;, Comparison&gt; data = Maps.newHashMap();
  public Comparison lookup(String searchTerm) {
      return data.get(searchTerm);
  }
  </code></pre>
  
  <p>Where Comparison Class is</p>
  
  <pre><code>public class Comparison {
  @Parsed(field = "ProductId1")
  private String productId1;
  
  @Parsed(field = "ProductId2")
  private String productId2;
  
  @Parsed(field = "ProductId3")
  private String productId3;
  
  @Parsed(field = "SearchTerm")
  private String SearchTerm;
  
  
  public String getProductId1() {
      return productId1;
  }
  
  public String getProductId2(){
      return productId2;
  }
  
  public String getProductId3(){
      return productId3;
  }
  
  public List&lt;String&gt; getProductIds(){
      List&lt;String&gt; ids = new ArrayList&lt;&gt;();
      Collections.addAll(ids, productId1, productId2, productId3);
      return ids;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My solution was bad. I was getting NullPointerException constantly whenever I tried to use lookup() method. </p>
  
  <p>Do you have any ideas how to make this work? Thank oyu</p>