public Path createNewFile(final @NotNull Clock clock) throws IOException {
    final int maxTries = 1024;
    try {
      final Path basePath = generatePath(clock);
      Path candidatePath = basePath;
      for (int tryNo = 0; tryNo < maxTries; tryNo++) {
        try {
          if (Files.exists(candidatePath)) {
            final String numeratedFileName = basePath.getFileName() + "." + tryNo;
            candidatePath = basePath.resolveSibling(numeratedFileName);
          }
          final Path createdPath = Files.createFile(candidatePath);
          return createdPath;
        }
        catch (FileAlreadyExistsException e) {
          // retry with a new candidate
        }
      }
      throw new IOException("Can't create new file like " + basePath + ".X in X=[0.." + maxTries + ") attempts");
    }
    finally {
      removeOlderFiles();
    }
  }
public Path createNewFile(final @NotNull Clock clock)