Android examples for java.util:Collection and Null
add object to Collection, null safe
//package com.java2s; import java.util.Collection; public class Main { public static boolean add(Collection collection, Object object) { if (collection == null || object == null) return false; collection.add(object);//from w w w . j a v a 2s. c o m return true; } }