Here you can find the source of sizeNotNull(final List
public static <E> int sizeNotNull(final List<E> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <E> int sizeNotNull(final List<E> list) { int count = 0; for (E e : list) { if (e != null) { count++;/* www. j a va 2 s . c o m*/ } } return count; } }