private static @NotNull PersistentMap<Integer, ByteArraySequence> createMap(@NotNull Path file,
                                                                              boolean useChunks,
                                                                              boolean isReadOnly,
                                                                              @Nullable StorageLockContext storageLockContext) throws IOException {
    assert PagedFileStorage.THREAD_LOCAL_STORAGE_LOCK_CONTEXT.get() == null || storageLockContext == null;
    PagedFileStorage.THREAD_LOCAL_STORAGE_LOCK_CONTEXT.set(storageLockContext);
    try {
      return PersistentMapBuilder
        .newBuilder(file, EnumeratorIntegerDescriptor.INSTANCE, ByteSequenceDataExternalizer.INSTANCE)
        .hasChunks(useChunks)
        .withReadonly(isReadOnly)
        .build();
    }
    finally {
      PagedFileStorage.THREAD_LOCAL_STORAGE_LOCK_CONTEXT.remove();
    }
  }
private static @NotNull PersistentMap<Integer, ByteArraySequence> createMap(@NotNull Path file,
                                                                              boolean useChunks,
                                                                              boolean isReadOnly,
                                                                              @Nullable StorageLockContext storageLockContext)