Java tutorial
//package com.java2s; import java.util.*; public class Main { public static int size(Collection<?> collection) { return (collection == null ? 0 : collection.size()); } public static int size(Collection<?>... collections) { int size = 0; if (collections != null) { for (Collection<?> c : collections) { if (c != null) { size += c.size(); } } } return size; } }