Here you can find the source of getNotNullId(final List
public static List<Long> getNotNullId(final List<Long> idList)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static List<Long> getNotNullId(final List<Long> idList) { List<Long> result = new ArrayList<Long>(); if (idList == null || idList.isEmpty()) return result; for (Long id : idList) if (id != null) result.add(id);//from w w w . j a va 2s .c o m return result; } }