Imagine that you have this situation:
List<String> al = new ArrayList<>();
al.add("[I] am");
al.add("you are");
al.add("I");
al.add("[I] like java");
Now I want to count the sequence [I] (in this case it will count 2 times). The Link How to count the number of occurrences of an element in a List just pust one word, but on my example I have more than one, i.e, Collections.frequency(al, "[I]") do not work.
How can I achieve this preferentially using Java 8 ?