code: public static <T> ImmutableMap<T, Integer> itemToIndexMapStartingFrom(final Iterable<T> sequence,
        int startFrom) {
      final ImmutableMap.Builder<T, Integer> ret = ImmutableMap.builder();
  
      int idx = startFrom;
      for (final T item : sequence) {
        ret.put(item, idx);
        ++idx;
      }
  
      return ret.build();
    }
docs: Transforms an Iterable<T> to a Map<T, Integer> where each item is mapped to its position in the
  Iterable's sequence, where the first position is given index {@code startFrom}. If an item
  occurs twice, an IllegalArgumentException will be thrown.