code: LedgerMetadata getLedger(long ledgerId) {
          int index = getLedgerMetadataIndex(ledgerId);
          if (index >= 0) {
              return this.ledgers.get(index);
          }
  
          return null;
      }
docs: Gets the LedgerMetadata for the ledger with given ledger Id.
  
  @param ledgerId The Ledger Id to search.
  @return The sought LedgerMetadata, or null if not found.