title: How do I filter the collection correctly in stream?
body: <p>The method comes with a map with the user name key and a Boolean value.
  The user names are the same as in the database.From the database comes a list of entities in which the user name and password.
  I need to compare the user names from the list of entities and the user names from the map in the flow and leave only those entities that have the same user name and the value &quot; true&quot;</p>
  <pre><code>public class BasicAuthUser {   
      private String username;
      private String password;
  }
  
  
  private void create(Map&lt;String, Boolean&gt; users) {
      var allUsersFromDB = basicAuthUserService.getAllUsers(); //List&lt;BasicAuthUsers&gt;
      var credentials = allUsersFromDB.stream()
          .filter ( ? )//basicAuthUser.getUsername().equals(users.getKey)&amp;&amp;users.getValue.equals(Boolean.TRUE)
          .map(user -&gt; user.getUsername(),user.getPassword())
          .collect(Collectors.joining());
  }
  </code></pre>