code: public static <T> Map<Integer, T> fromIterable(
          Iterable<? extends T> iterable)
      {
          Map<Integer, T> map = new LinkedHashMap<Integer, T>();
          int i = 0;
          for (T t : iterable)
          {
              map.put(i, t);
              i++;
          }
          return map;
      }
docs: Creates a map that maps consecutive integer values to the elements
  in the given sequence, in the order in which they appear.
  
  @param <T> The value type
  @param iterable The sequence
  @return The map