public static long[] asLongArray(final List<Long> l){
  final long[] a=new long[l.size()];
  for (int i=0; i < a.length; i++) {
    a[i]=l.get(i);
  }
  return a;
}

public static long [ ] asLongArray ( final List < Long > l ) { final long [ ] a = new long [ l . size ( ) ] ; for ( int i = 0 ; i < a . length ; i ++ ) { a [ i ] = l . get ( i ) ; } return a ; }
return list of boxed longs as a primitive array .
