Here you can find the source of convertAllElementsToLong(P bigIntegers)
public static <P extends Collection<BigInteger>> List<Long> convertAllElementsToLong(P bigIntegers)
//package com.java2s; import java.math.BigInteger; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <P extends Collection<BigInteger>> List<Long> convertAllElementsToLong(P bigIntegers) { if (bigIntegers == null) { return null; }/* w ww .j a v a2 s . co m*/ try { ArrayList<Long> results = new ArrayList<Long>(); for (BigInteger bigInteger : bigIntegers) { results.add(bigInteger.longValue()); } return results; } catch (Exception e) { throw new RuntimeException(e); } } }