### Question:
DocumentSet implements Iterable<Document> { @Nullable public Document getDocument(DocumentKey key) { return keyIndex.get(key); } private  DocumentSet(
      ImmutableSortedMap<DocumentKey, Document> keyIndex, ImmutableSortedSet<Document> sortedSet); static DocumentSet emptySet(final Comparator<Document> comparator); int size(); boolean isEmpty(); boolean contains(DocumentKey key); @Nullable Document getDocument(DocumentKey key); @Nullable Document getFirstDocument(); @Nullable Document getLastDocument(); @Nullable Document getPredecessor(DocumentKey key); int indexOf(DocumentKey key); DocumentSet add(Document document); DocumentSet remove(DocumentKey key); List<Document> toList(); @Override @NonNull Iterator<Document> iterator(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testDocumentForKey() { DocumentSet set = docSet(TEST_COMPARATOR, DOC1, DOC2); assertEquals(DOC1, set.getDocument(DOC1.getKey())); assertEquals(DOC2, set.getDocument(DOC2.getKey())); assertNull(set.getDocument(DOC3.getKey())); }