code: LogMetadata removeEmptyLedgers(int skipCountFromEnd) {
          val newLedgers = new ArrayList<LedgerMetadata>();
          int cutoffIndex = this.ledgers.size() - skipCountFromEnd;
          for (int i = 0; i < cutoffIndex; i++) {
              LedgerMetadata lm = this.ledgers.get(i);
              if (lm.getStatus() != LedgerMetadata.Status.Empty) {
                  // Not Empty or Unknown: keep it!
                  newLedgers.add(lm);
              }
          }
  
          // Add the ones from the end, as instructed.
          for (int i = cutoffIndex; i < this.ledgers.size(); i++) {
              newLedgers.add(this.ledgers.get(i));
          }
  
          return new LogMetadata(this.epoch, this.enabled, Collections.unmodifiableList(newLedgers), this.truncationAddress, this.updateVersion.get());
      }
docs: Removes LedgerMetadata instances for those Ledgers that are known to be empty.
  
  @param skipCountFromEnd The number of Ledgers to spare, counting from the end of the LedgerMetadata list.
  @return A new instance of LogMetadata with the updated ledger list.