Here you can find the source of getArrayNoNull(Object[] array)
public static Object[] getArrayNoNull(Object[] array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static Object[] getArrayNoNull(Object[] array) { if (array != null && array.length > 0) { List<Object> result = new ArrayList<>(); for (Object obj : array) { if (!isNull(obj)) result.add(obj);//from w w w. j av a 2s . c om } return result.toArray(); } return null; } public static boolean isNull(Object... objects) { boolean result = false; for (int i = 0; i < objects.length; i++) { if (objects[i] == null) { result = true; continue; } } return result; } }