if (committedSnapshot != null) {
ReadableWaveletData snapshot = committedSnapshot.snapshot;
if (waveref.hasDocumentId()) {
// We have a wavelet id and document id. Find the document in the
// snapshot and return it.
DocumentSnapshot docSnapshot = null;
for (String docId : snapshot.getDocumentIds()) {
if (docId.equals(waveref.getDocumentId())) {
docSnapshot = SnapshotSerializer.serializeDocument(snapshot.getDocument(docId));
break;
}