title: Java, get Keys from Map that has data from FireStore
body: <p>I'm getting data from FireStore into a Map, my data in Firestore looks like this:  </p>
  
  <pre><code>(Auto-Document ID)
      title="title1"
      body="body1"
  (Auto-Document ID)
      title="title2"
      body="body2"
  </code></pre>
  
  <p>As I load them in a Map, it'll look like this:  </p>
  
  <blockquote>
    <p>loadNoteCallBack: {rsmw3EkfIjUQxrzRiyy7={body=body2, title=title2}, sTEfYCcPK9lw77xWS8H5={body=body1, title=title1}}</p>
  </blockquote>
  
  <p>"rsmw3EkfIjUQxrzRiyy7" and "sTEfYCcPK9lw77xWS8H5" are the Auto generated document ID-s  </p>
  
  <p>Now my problem is, I wanna extract the <strong>titles</strong> from them, and I don't exactly know how.<br>
  I've tried this:  </p>
  
  <pre><code>List&lt;String&gt; keys = new ArrayList&lt;&gt;();
  
  for (String key : data.keySet()) {
      keys.add(key);
  }
  </code></pre>
  
  <p>But I got back the document ID-s this way.  </p>
  
  <blockquote>
    <p>titles: [rsmw3EkfIjUQxrzRiyy7, sTEfYCcPK9lw77xWS8H5]</p>
  </blockquote>
  
  <p>How should I get the titles?</p>
  
  <p><strong>update</strong>  </p>
  
  <p>I think I did it. Is it a good solution for this problem?</p>
  
  <pre><code>    public static void loadNote() {
      db.collection("Datas")
              .get()
              .addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
                  @Override
                  public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
                      if (task.isSuccessful()) {
                          Map&lt;String, Object&gt; data = new HashMap&lt;&gt;();
                          List&lt;String&gt; titles = new ArrayList&lt;&gt;();
                          for (QueryDocumentSnapshot document : task.getResult()) {
                              titles.add(document.getString("title"));
                              data.put(document.getId(),document.getData());
                          }                            
                          defaultEntitys.loadNoteCb(data,titles);
                      } else {
                          Log.d(TAG, "Error getting documents: ", task.getException());
                      }
                  }
              });
  </code></pre>