private static Supplier<? extends OffsetsInFile> skipWriteLockIfNeeded(boolean skipWriteLock, Supplier<? extends OffsetsInFile> toWrap) {
    if (skipWriteLock) {
      return toWrap;
    }
    else {
      return () -> WriteAction.compute(() -> toWrap.get());
    }
  }
private static Supplier<? extends OffsetsInFile> skipWriteLockIfNeeded(boolean skipWriteLock, Supplier<? extends OffsetsInFile> toWrap)