private static @NotNull Pair<Object2IntMap<String>, String[]> readStorageFromDisk(@NotNull Path file,
                                                                                    @NotNull Charset charset,
                                                                                    @NotNull Charset charsetToFallback) throws IOException {
    //RC: Why we need charsetToFallback: backward-compatibility reasons. For a long time, SimpleStringPersistentEnumerator
    //    actually used defaultCharset() to read-write data, even though it _promised_ to use UTF-8 -- so now we have
    //    to deal with files in a defaultCharset().
    //MAYBE RC: I think, after 1-2 releases it will be OK to remove 'charsetToFallback' branch, and use only UTF-8
    List<String> lines;
    try {
      lines = Files.readAllLines(file, charset);
    }
    catch (IOException exMainCharset) {
      //maybe it is CharacterCodingException? Try reading with fallback charset
      try {
        lines = Files.readAllLines(file, charsetToFallback);
      }
      catch (IOException exFallbackCharset) {
        exFallbackCharset.addSuppressed(exMainCharset);
        throw exFallbackCharset;
      }
    }

    Object2IntMap<String> nameToIdRegistry = new Object2IntOpenHashMap<>(lines.size());
      String[] idToNameRegistry = lines.isEmpty() ? ArrayUtilRt.EMPTY_STRING_ARRAY : new String[lines.size()];
    for (int i = 0; i < lines.size(); i++) {
      String name = lines.get(i);
      int id = i + 1;
      nameToIdRegistry.put(name, id);
      idToNameRegistry[i] = name;
    }
    return Pair.create(nameToIdRegistry, idToNameRegistry);
  }
private static @NotNull Pair<Object2IntMap<String>, String[]> readStorageFromDisk(@NotNull Path file,
                                                                                    @NotNull Charset charset,
                                                                                    @NotNull Charset charsetToFallback)