code: public static <E> List<E> asList(Iterable<E> i) {
          if (i instanceof Collection) {
              return new ArrayList<E>((Collection<E>) i);
          }
          ArrayList<E> a = new ArrayList<E>();
          for (E e : i) {
              a.add(e);
          }
          return a;
      }
docs: Turns the iterable into a list.