code: public static <T> void copy(List<? super T> dest, List<? extends T> src) {
          int srcSize = src.size();
          if (srcSize > dest.size())
              throw new IndexOutOfBoundsException("Source does not fit in dest");
  
          if (srcSize < COPY_THRESHOLD ||
              (src instanceof RandomAccess && dest instanceof RandomAccess)) {
              for (int i=0; i<srcSize; i++)
                  dest.set(i, src.get(i));
          } else {
              ListIterator<? super T> di=dest.listIterator();
              ListIterator<? extends T> si=src.listIterator();
              for (int i=0; i<srcSize; i++) {
                  di.next();
                  di.set(si.next());
              }
          }
      }
docs: Copies all of the elements from one list into another.  After the
  operation, the index of each copied element in the destination list
  will be identical to its index in the source list.  The destination
  list must be at least as long as the source list.  If it is longer, the
  remaining elements in the destination list are unaffected. <p>
  
  This method runs in linear time.
  
  @param  <T> the class of the objects in the lists
  @param  dest The destination list.
  @param  src The source list.
  @throws IndexOutOfBoundsException if the destination list is too small
  to contain the entire source List.
  @throws UnsupportedOperationException if the destination list's
  list-iterator does not support the <tt>set</tt> operation.