private LogSegment getLogSegment(LogSegmentName name, long capacityInBytes, boolean writeHeader)
      throws IOException, StoreException {
    File file = create(tempDir, name.toFilename());
    return new LogSegment(name, file, capacityInBytes, createStoreConfig(capacityInBytes, true),
        Mockito.mock(StoreMetrics.class), writeHeader);
  }
A test util method to get a log segment for a given logSegmentName.
@param name the name of the log segment.
@param capacityInBytes the capacity of the log segment.
@param writeHeader whether to write the header or not.
@return the created {@link BlobStore}.
ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java