code: LogMetadata updateLedgerStatus(Map<Long, Long> lastAddConfirmed) {
          if (lastAddConfirmed.isEmpty()) {
              // Nothing to change.
              return this;
          }
  
          val newLedgers = this.ledgers.stream()
                  .map(lm -> {
                      long lac = lastAddConfirmed.getOrDefault(lm.getLedgerId(), Long.MIN_VALUE);
                      if (lm.getStatus() == LedgerMetadata.Status.Unknown && lac != Long.MIN_VALUE) {
                          LedgerMetadata.Status e = lac == Ledgers.NO_ENTRY_ID
                                  ? LedgerMetadata.Status.Empty
                                  : LedgerMetadata.Status.NotEmpty;
                          lm = new LedgerMetadata(lm.getLedgerId(), lm.getSequence(), e);
                      }
  
                      return lm;
                  })
                  .collect(Collectors.toList());
          return new LogMetadata(this.epoch, this.enabled, Collections.unmodifiableList(newLedgers), this.truncationAddress, this.updateVersion.get());
      }
docs: Updates the LastAddConfirmed on individual LedgerMetadata instances based on the provided argument.
  
  @param lastAddConfirmed A Map of LedgerId to LastAddConfirmed based on which we can update the status.
  @return This (unmodified) instance if lastAddConfirmed.isEmpty() or a new instance of the LogMetadata class with
  the updated LedgerMetadata instances.