code: private <V> BiMap<V, Integer> createIndex(Set<V> values) {
      if (values == null) {
        return null;
      }
  
      ImmutableBiMap.Builder<V, Integer> builder = ImmutableBiMap.builder();
      int idx = 0;
      for (V value : values) {
        builder.put(value, idx++);
      }
      return builder.build();
    }
docs: Creates a map of indexes based on the iteration order of the given set.
  
  @param values Set of values to create index on
  @return A map from the values to indexes in the set iteration order.