private static <T> BiMap<T, String> buildBiMap(Iterable<T> values) {
    @SuppressWarnings("unchecked")
    Suggester<T> suggester = (Suggester<T>) PREFIX_SUGGESTER;
    final BiMap<T, String> map = HashBiMap.create();
    for (T value: values) {
      if (!map.containsKey(value)) {
        String name;
        for (int i = 0; ; i++) {
          name = suggester.suggest(value, i, map.size());
          if (!map.containsValue(name)) {
            map.put(value, name);
            break; // name found, break the loop
          }
        }
      }
    }

    return ImmutableBiMap.copyOf(map);
  }
Gives an unique (generated) name to objects so they can be used as identifiers in queries.
Same objects (as defined by object equality) will have same name.

@param <T>
criteria/common/src/org/immutables/criteria/backend/UniqueCachedNaming.java