title: What is equivalent to C#'s Select clause in JAVA's streams API
body: <p>I wanted to filter list of Person class and finally map to some anonymous class in Java using Streams. I am able to do the same thing very easily in C#.</p>
  
  <p>Person class</p>
  
  <pre><code>class Person
  {
      public int Id { get; set; }
  
      public string Name { get; set; }
  
      public string Address { get; set; }
  }
  </code></pre>
  
  <p>Code to map the result in desire format.</p>
  
  <pre><code> List&lt;Person&gt; lst = new List&lt;Person&gt;();
  
   lst.Add(new Person() { Name = "Pava", Address = "India", Id = 1 });
   lst.Add(new Person() { Name = "tiwari", Address = "USA", Id = 2 });
   var result = lst.Select(p =&gt; new { Address = p.Address, Name = p.Name }).ToList();
  </code></pre>
  
  <p>Now if I wanted to access any property of newly created type I can easily access by using below mentioned syntax.</p>
  
  <pre><code>Console.WriteLine( result[0].Address);
  </code></pre>
  
  <p>Ideally I should use loop to iterate over the result.</p>
  
  <p>I know that in java we have collect for ToList and map for Select.
  But i am unable to select only two property of Person class.
  How can i do it Java</p>