code: synchronized void addChunk(SegmentChunk segmentChunk, SegmentHandle activeChunkHandle) {
          Preconditions.checkState(!this.sealed, "Cannot add SegmentChunks for a Sealed Handle.");
          if (this.segmentChunks.size() > 0) {
              long expectedOffset = this.segmentChunks.get(this.segmentChunks.size() - 1).getLastOffset();
              Preconditions.checkArgument(segmentChunk.getStartOffset() == expectedOffset,
                      "Invalid SegmentChunk StartOffset. Expected %s, given %s.", expectedOffset, segmentChunk.getStartOffset());
          }
  
          // Update the SegmentChunk and its Handle atomically.
          Preconditions.checkNotNull(activeChunkHandle, "activeChunkHandle");
          Preconditions.checkArgument(!activeChunkHandle.isReadOnly(), "Active SegmentChunk handle cannot be readonly.");
          Preconditions.checkArgument(activeChunkHandle.getSegmentName().equals(segmentChunk.getName()),
                  "Active SegmentChunk handle must be for the last SegmentChunk.");
          this.activeChunkHandle = activeChunkHandle;
          this.segmentChunks.add(segmentChunk);
      }
docs: Adds a new SegmentChunk.
  
  @param segmentChunk      The SegmentChunk to add. This SegmentChunk must be in continuity of any existing SegmentChunks.
  @param activeChunkHandle The newly added SegmentChunk's write handle.