So i'm trying to pass this test:
public void testCountWithCondition() {
List<Integer> data = Arrays.asList(1, 3, 8, 4, 6);
int count = streamer.count(data, x -> x % 3 == 0);
assertEquals(2, count);
}
I'm having a really hard time understanding how to create a method count
that can take the lambda expression as an argument. I've seen other posts that say you need to create an interface class but how do I program it to be able to accept any lambda expression? Also, the assignment specifically says I need to use streams. Thanks!