public static <T>int copy(final List<T> from,int first,int last,List<T> to){
  int i=first;
  for (; i < last; i++) {
    to.add(from.get(i));
  }
  return i;
}

public static < T > int copy ( final List < T > from , int first , int last , List < T > to ) { int i = first ; for ( ; i < last ; i ++ ) { to . add ( from . get ( i ) ) ; } return i ; }
std : copy : copy range of elements copies the elements in the range [ first , last ) into a range beginning at result . returns an iterator to the last element in the destination range parameters first , last input iterators to the initial and final positions in a sequence to be copied . the range used is [ first , last ) , which contains all the elements between first and last , including the element pointed by first but not the element pointed by last . result output iterator to the initial position in the destination sequence . this shall not point to any element in the range [ first , last ) .
