title: Java - Filter Returning Null Value
body: <p>I am trying to filter list but it returning null value for every search. I tried every possible ways but nothing happened. please help me on this </p>
  
  <pre><code>public class IssuerCreditDetailsUpdate implements ItemProcessor&lt;Isin_Master, Issuer_credit_rating_details&gt; {
  
      protected final Logger logger = Logger.getLogger(this.getClass().getName());
      static ArrayList&lt;Credit_rating_details&gt; Credit = new ArrayList&lt;Credit_rating_details&gt;();
      private String validCreditRating = null;
  
      @Override
      public Issuer_credit_rating_details process(Isin_Master item) throws Exception {
          Issuer_credit_rating_details row = new Issuer_credit_rating_details();
          if(isCreditRatingValid(item.getIssuer_Id())!= null) {   
                          row.setIssuer_id(item.getIssuer_Id());
              row.setName_of_issuer(item.getIssuerName());
  
              return row;
          }
  
          return null;
      }
  
      private String isCreditRatingValid(String issuerid) {
          System.out.println(Credit.stream().filter(i-&gt; i.getIssuer_id().contains(issuerid)).collect(Collectors.toList()));
          List&lt;Credit_rating_details&gt; result = Credit.stream().filter(i-&gt; i.getIssuer_id().contains(issuerid)).collect(Collectors.toList());
          if(!result.isEmpty() ) {
  
              validCreditRating = result.get(0).getCredit_rating();
              return result.get(0).getCredit_rating();
          }else {
              return null;
          }
      }
  }
  </code></pre>