Here you can find the source of toLongList(List
public static List<Long> toLongList(List<String> members)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Main { public static List<Long> toLongList(List<String> members) { if (isEmpty(members)) { return null; }//w ww . j a v a 2s.c om List<Long> result = new ArrayList<Long>(); Iterator<String> iterator = members.iterator(); while (iterator.hasNext()) { String str = iterator.next(); if (str == null) { result.add(null); } else { long member = Long.parseLong(str); result.add(member); } } return result; } public static boolean isEmpty(List<?> list) { if (list == null || list.isEmpty()) { return true; } else { return false; } } }