code: public static long[] unbox(List<Long> list) {
          long[] res = new long[list.size()];
          for (int i = 0; i < res.length; i++) {
              res[i] = list.get(i);
          }
          return res;
      }
docs: Unboxing long list
  
  @param list source list
  @return result