code: public static <K, E> Collector<E, Map<K, E>, ImmutableMap<K, E>> uniqueIndex(Function<? super E, K> keyFunction) {
      return uniqueIndex(keyFunction, Function.<E>identity());
    }
docs: Creates an {@link ImmutableMap} from the stream where the values are the values in the stream and the keys are the
  result of the provided {@link Function keyFunction} applied to each value in the stream.
  
  <p>
  The {@link Function keyFunction} must return a unique (according to the key's type {@link Object#equals(Object)}
  and/or {@link Comparable#compareTo(Object)} implementations) value for each of them, otherwise a
  {@link IllegalArgumentException} will be thrown.
  </p>
  
  <p>
  {@link Function keyFunction} can't return {@code null}, otherwise a {@link NullPointerException} will be thrown.
  </p>
  
  @throws NullPointerException if {@code keyFunction} is {@code null}.
  @throws NullPointerException if result of {@code keyFunction} is {@code null}.
  @throws IllegalArgumentException if {@code keyFunction} returns the same value for multiple entries in the stream.