code: public static <E> List<E> copyOf(Iterable<? extends E> elements) {
      Preconditions.checkNotNull(elements, "elements");
      List<E> result = (elements instanceof Collection)
          // can pre-allocate the array
          ? new ArrayList<>(cast(elements).size())
          // cannot
          : new ArrayList<>();
      for (E e : elements) {
        result.add(e);
      }
      return Collections.unmodifiableList(result);
    }
docs: Returns an unmodifiable view of the list composed of elements.
  
  @param elements Iterable of elements.
  @param <E>      Type of the elements of the list.
  @return an unmodifiable view of the list composed of elements.