title: Verify that all key/value pairs in a Map are present in another Map
body: <p>I have a List of objects containing a Map.
  The object looks like this :</p>
  
  <pre><code>public class SwiftObject {
      private Map&lt;String, String&gt; metadata;
      ...
  }
  </code></pre>
  
  <p>I'm trying to filter my objects based on the keys and values stored in their Map.<br/>
  My filter criteria are contained in another Map.<br/>
  I'd like to filter and keep all the objects which Map has all key/value contained in the filter Map.</p>
  
  <p>This is the code I wrote :</p>
  
  <pre><code>List&lt;? extends SwiftObject&gt; swiftObjects = documentStore.listAllObjects(container);
  Map&lt;String, String&gt; searchMetadata = gssDocument.getMetadataMap();
  List&lt;SwiftObject&gt; filteredSwiftObjects = swiftObjects.stream()
              .filter(swiftObject -&gt;
                      searchMetadata.entrySet().stream()
                      .allMatch(entry -&gt; entry.getValue().equals(swiftObject.getMetadata().get(entry.getKey())))
                      )
              .collect(Collectors.ToList());
  </code></pre>
  
  <p>Is it the right way to do this or can it be refactored/optimized?<br/>
  The searchMetadata map does not contain null values</p>