// "Replace Stream API chain with loop" "true" import java.util.List; import java.util.function.Predicate; public class Main { static Predicate nonEmpty = s -> s != null && !s.isEmpty(); private static long test(List strings) { return strings.stream().filter(nonEmpty).count(); } public static void main(String[] args) { } }