title: map() with JSON array
body: <p><strong>Not Looking for Jackson Solution.</strong></p>
  
  <blockquote>
    <p>List of Imports:</p>
  </blockquote>
  
  <pre><code>import java.io.File;
  import java.io.FileReader;
  import java.util.ArrayList;
  import org.json.simple.JSONArray;
  import org.json.simple.JSONObject;
  import org.json.simple.parser.JSONParser;
  import java.util.List;
  import java.util.stream.Collectors;
  </code></pre>
  
  <p><strong>JSON data:</strong></p>
  
  <pre><code>{
      "Name": "ABC.com",
      "Developer": "Vishwa ratna",
      "Project List": [
          "Compnay: National",
          "Compnay: Enterprise",
          "Compnay: Alamo"
      ]
  }
  </code></pre>
  
  <p><strong>My program:</strong></p>
  
  <pre><code> @SuppressWarnings("unchecked")
      public  static  void main(String[] args)
      {
          File text = new File("R:/TestJSON.txt");
          JSONParser parser = new JSONParser();
          try {
              Object obj = parser.parse(new FileReader("R:\\Desktop\\TestJSON.txt"));
              JSONObject jsonObject = (JSONObject) obj;
              List&lt;String&gt; list = new ArrayList&lt;&gt;();
              String name = (String) jsonObject.get("Name");
              System.out.println(name);
              String author = (String) jsonObject.get("Developer");
              System.out.println(author);
              JSONArray companyList = (JSONArray) jsonObject.get("Project List");
              companyList.stream().map(e-&gt;{if(e.equals("Compnay: National")); return e;}).collect(Collectors.toList());
              list.forEach(System.out::println);
          }
          catch (Exception e)
          {}
      }
  }
  </code></pre>
  
  <p>Everything is executing correctly except </p>
  
  <pre><code>companyList.stream().map(e-&gt;{if(e.equals("Compnay: National")); return e;}).collect(Collectors.toList());
              list.forEach(System.out::println);
  </code></pre>
  
  <p>I can get the desired result another way around but i want to know why my map is not returning anything?? should it not return <code>Compnay: National</code>.</p>
  
  <p>Result i am getting:</p>
  
  <pre><code>ABC.com
  Vishwa ratna
  </code></pre>
  
  <p>I am expecting:</p>
  
  <pre><code>ABC.com
  Vishwa ratna
  Compnay: National
  </code></pre>
  
  <p><strong>Edit:</strong> Even after using <code>filter()</code> as suggested by some people here i am unable to get the desired result.</p>