code: public static StreamTruncationRecord complete(StreamTruncationRecord toComplete) {
          Preconditions.checkState(toComplete.updating);
          ImmutableSet.Builder<Long> builder = ImmutableSet.builder();
          
          builder.addAll(toComplete.deletedSegments);
          builder.addAll(toComplete.toDelete);
  
          return StreamTruncationRecord.builder()
                                       .updating(false)
                                       .span(toComplete.span)
                                       .streamCut(toComplete.streamCut)
                                       .deletedSegments(builder.build())
                                       .toDelete(ImmutableSet.of())
                                       .sizeTill(toComplete.sizeTill)
                                       .build();
      }
docs: Method to complete a given ongoing truncation record by setting updating flag to false and merging toDelete in deletedSegments.
  @param toComplete record to complete
  @return new record that has the updating flag set to false