code: public long getVersion() {
      long version = 1;
  
      ArrayList<String> indices = new ArrayList<>(getIndices().keySet());
      Collections.sort(indices);
      for (String index : indices) {
        version = 31 * version + getIndices().get(index);
      }
  
      return version;
    }
docs: Returns the version for the set of indices.