code: public static <E, T extends E> void add(List<E> list, int index, T item){
          if(index<list.size())
              list.add(index, item);
          else
              list.add(item);
      }
docs: Adds the given item to the list at specified <code>index</code>.
  if <code>index</code> is greater than list size, it simply appends
  to the list.