The following two lines:
Boolean visitedAlphabet[] = new Boolean[26];
Arrays.stream(visitedAlphabet).anyMatch(e -> e != true);
Produce a nullpointer, the second line to be specific:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "<parameter1>" is null
Could you please tell me why this happens?