title: Retrieve single object from list using java8 stream api
body: <p>I have a list of <code>Employee</code>, and I want to retrieve only one <code>Employee</code> information with the specific name: </p>
  
  <pre><code>public static Employee getAllEmployeeDetails(String employeeName) {
      List&lt;Employee&gt; empList = getAllEmployeeDetails();
      Employee employee = empList.stream().filter(x -&gt; x.equals(employeeName));
      return employee;
  }
  </code></pre>
  
  <p>Please let me know how to filter the data and return a single element.</p>