code: public String create(String id, Integer size, HashSet<String> data, String originalVersion)
        throws IOException {
      if (collectionCachePath != null) {
        // initialization
        Date date = clear();
        // create always new version, unless explicit original version is provided
        String version;
        if(originalVersion!=null&&versionToItem.containsKey(originalVersion)) {
          version = originalVersion;
        } else {
          do {
            version = UUID.randomUUID().toString();
          } while (versionToItem.containsKey(version));
        }  
        // create new item
        MtasSolrCollectionCacheItem item;
        if (id != null) {
          item = new MtasSolrCollectionCacheItem(id, size, data);
          // remove if item with id already exists
          deleteById(id);
        } else {
          item = new MtasSolrCollectionCacheItem(version, size, data);
        }
        // register
        idToVersion.put(id, version);
        expirationVersion.put(version, date.getTime() + (1000 * lifeTime));
        versionToItem.put(version, item);
        // store data in file
        File file = collectionCachePath.resolve(version).toFile();
        try (OutputStream outputStream = new FileOutputStream(file);
            Writer outputStreamWriter = new OutputStreamWriter(outputStream,
                StandardCharsets.UTF_8);) {
          outputStreamWriter.write(encode(item));
          // set correct time to reconstruct administration on restart
          if (!file.setLastModified(date.getTime())) {
            log.debug("couldn't change filetime " + file.getAbsolutePath());
          }
          // don't store data in memory
          item.data = null;
          // return version
          return version;
        } catch (IOException e) {
          idToVersion.remove(id);
          expirationVersion.remove(version);
          versionToItem.remove(version);
          throw new IOException("couldn't create " + version, e);
        }
      } else {
        throw new IOException("no cachePath available, can't store data");
      }
    }
docs: Creates the.
  
  @param id the id
  @param size the size
  @param data the data
  @return the string
  @throws IOException Signals that an I/O exception has occurred.