code: private void updateMetadata(SegmentProperties segmentProperties) {
          this.metadata.setStorageLength(segmentProperties.getLength());
          if (segmentProperties.isSealed() && !this.metadata.isSealedInStorage()) {
              this.metadata.markSealed();
              this.metadata.markSealedInStorage();
          }
      }
docs: Updates the metadata and based on the given SegmentProperties object.
  
  @param segmentProperties The SegmentProperties object to update from.