public static <E>ArrayList<E> list(E... elements){
  ArrayList<E> list=new ArrayList<E>();
  for (  E element : elements)   list.add(element);
  return list;
}

public static < E > ArrayList < E > list ( E ... elements ) { ArrayList < E > list = new ArrayList < E > ( ) ; for ( E element : elements ) list . add ( element ) ; return list ; }
add elements to an arraylist .
