public static List<Long> toLongList(@Nullable long[] arr){
  if (arr == null || arr.length == 0)   return Collections.emptyList();
  List<Long> ret=new ArrayList<>(arr.length);
  for (  long l : arr)   ret.add(l);
  return ret;
}

public static List < Long > toLongList ( @ Nullable long [ ] arr ) { if ( arr == null || arr . length == 0 ) return Collections . emptyList ( ) ; List < Long > ret = new ArrayList < > ( arr . length ) ; for ( long l : arr ) ret . add ( l ) ; return ret ; }
converts array of longs into list .
