Java tutorial
//package com.java2s; import java.util.Collection; import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; public class Main { public static int countFalse(String propertyName, Collection<?> collection) { int count = 0; for (Object o : collection) { BeanWrapper bw = new BeanWrapperImpl(o); Boolean propertyValue = (Boolean) bw.getPropertyValue(propertyName); if (Boolean.FALSE.equals(propertyValue)) { count++; } } return count; } }