code: private void checkValidOperation(SegmentOperation operation) throws DataCorruptionException {
          // Verify that the SegmentOperation has been routed to the correct SegmentAggregator instance.
          Preconditions.checkArgument(
                  operation.getStreamSegmentId() == this.metadata.getId(),
                  "Operation '%s' refers to a different Segment than this one (%s).", operation, this.metadata.getId());
  
          // After Sealing, we can only Truncate or Delete a Segment.
          if (this.hasSealPending.get() && !isTruncateOperation(operation) && !isDeleteOperation(operation)) {
              throw new DataCorruptionException(String.format("Illegal operation for a sealed Segment; received '%s'.", operation));
          }
      }
docs: Ensures the following conditions are met:
  * SegmentId matches this SegmentAggregator's SegmentId
  * If Segment is Sealed, only TruncateSegmentOperations are allowed.
  * If Segment is deleted, no further operations are allowed.
  
  @param operation The operation to check.
  @throws IllegalArgumentException If any of the validations failed.