private LogSegment getLogSegment(LogSegmentName name, long capacityInBytes, boolean writeHeader)
      throws IOException, StoreException {
    File file = create(name.toFilename());
    return new LogSegment(name, file, capacityInBytes, createStoreConfig(capacityInBytes, setFilePermissionEnabled),
        metrics, writeHeader);
  }
Returns a {@link LogSegment} instance with name {@code name} and capacity {@code capacityInBytes}.
@param name the name of the {@link LogSegment} instance.
@param capacityInBytes the capacity of the {@link LogSegment} instance.
@param writeHeader {@code true} if headers should be written.
@return a {@link LogSegment} instance with name {@code name} and capacity {@code capacityInBytes}.
@throws IOException
ambry-store/src/test/java/com/github/ambry/store/LogTest.java