title: Finding a message across multiple folder trees with one call with microsoft-graph java sdk
body: <p>In converting from an older bit of code that uses the EWS (<code>ews-java-api v 2.0</code>) SDK/API/Scope to Graph (<code>microsoft-graph v5.4.0</code>), I found that I could search (say by InternetMessageId) across multiple folder hierarchies at once in EWS with (simplifying how to get FolderId values a bit):</p>
  <pre><code>SearchFilter.SearchFilterCollection filter =
              new SearchFilter.SearchFilterCollection(LogicalOperator.And);
  filter.add(new SearchFilter.IsEqualTo(EmailMessageSchema.InternetMessageId, msgId));
  List&lt;FolderId&gt; folders = Arrays.asList(new FolderId(&quot;AllItems&quot;), new FolderId(&quot;Deletions&quot;));
  ItemView view = new ItemView(10);
  ServiceResponseCollection&lt;FindItemResponse&lt;Item&gt;&gt; findResultsCollection =
              service.findItems(searchFolders, filter, null, view, null, ReturnErrors);
  </code></pre>
  <p>With that EWS search whether my message of interest is in the Inbox, some user-created sub-folder, JunkEmail, DeletedItems, RecoverableItemsDeletions I find it by InternetMessageId in one go.</p>
  <p>With Graph I issue two calls to be able to ensure the message does not exist</p>
  <pre><code>UserRequestBuilder u = GraphServiceClient
        .builder()
        .authenticationProvider(authenticationProvider)
        .buildClient()
        .users(user);
  
  for (String folderTree : Arrays.asList(&quot;AllItems&quot;, &quot;RecoverableItemsDeletions&quot;)) {
      MessageCollectionPage mcp = u.mailFolders(folderTree)
        .messages()
        .buildRequest()
        .filter(&quot;internetMessageId eq '&quot; + msgId + &quot;'&quot;)
        .get();
  </code></pre>
  <p>Is there a way to search multiple trees in one go with Graph to be more like the EWS path that took a List?</p>