public static int countProjectsWithoutUser() throws Exception { ResponseProjectsLst rpl = (ResponseProjectsLst) XmlHelpers.deserializeFromXml( ResponseProjectsLst.class, new File("data/responseswithuser500.xml")); IPredicate<ResponseProjects> isWithoutUser = new IPredicate<ResponseProjects>() { @Override public boolean invoke(ResponseProjects rp) { return rp.user == null; } }; return Func.count(isWithoutUser, rpl.responseProjs); }