boolean (List<String> list) { boolean b = true; for (String s : list) { if (s.isEmpty()) { b = false; break; } } boolean x = b && list.stream().anyMatch(Objects::isNull) && list.size() > 2; return x; }