title: How use stream filter for list of hashmap? ArrayList<HashMap<String, Object>>
body: <p>I want to filter an array list containing hash maps using the stream API.</p>
  
  <pre><code>ArrayList&lt;HashMap&lt;String, Object&gt;&gt; resultslist = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();   
  
  
  ResultSet rs = pstmt.executeQuery();
  
  while (rs.next()) {
      HashMap&lt;String, Object&gt; returndatas = new HashMap&lt;String, Object&gt;();
      int colcnt = rs.getMetaData().getColumnCount();
  
      for (int i = 1; i &lt;= colcnt; i++) {
          if (rs.getObject(i) instanceof BigInteger) {
              returndatas.put(rs.getMetaData().getColumnName(i), rs.getInt(i));
          } else {
              returndatas.put(rs.getMetaData().getColumnName(i), rs.getObject(i));
          }
      }
      resultslist.add(returndatas);
  }
  </code></pre>
  
  <p>The above method gives the <code>resultslist</code>. Now I want to filter this list by some condition and collect a new array list of hash maps.</p>
  
  <p>For example, I want to select hash maps that have a "null" value and string have "parent_item_id".</p>
  
  <p>I tried the following.</p>
  
  <pre><code>    ArrayList&lt;HashMap&lt;String, Object&gt;&gt; reducedList = resultslist .stream()
      .filter((HashMap&lt;String, Object&gt; hasmap) -&gt; hasmap.entrySet().stream().anyMatch(e -&gt; e.getKey().equals("parent_item_id") &amp;&amp; e.getValue().equals(0)))
      .collect(Collectors.toList());
  </code></pre>
  
  <p><strong>Finally, it's working</strong></p>
  
  <p>I used this. Thankyou for all</p>
  
  <pre><code>List&lt;HashMap&lt;String, Object&gt;&gt; reducedList = resultslist.stream()
                      .filter(hashmap -&gt;((hashmap.get("parent_item_id")) == null ))
                      .collect(Collectors.toList());
  </code></pre>