Android examples for java.util:Collection Size
Check if Collection has the Size
//package com.java2s; import java.util.Collection; public class Main { public static boolean hasSize(Collection<? extends Object> source, int expectedSize) { if (source == null) { return false; }/*from w ww . j a v a2 s . c o m*/ return source.size() == expectedSize; } }