I am using Stream.anymatch to check if any of the four string is empty or null- Can we get handle to the list of Strings that are null as a part of this check for subsequent logic
if(Stream.of(stringA, stringB,stringC, stringD)
.anyMatch(field -> field == null || field.trim().isEmpty()))
stream.filter(predicate).collect(toList()), then check the result for emptiness. You can't store the matching strings from anyMatch like you want.Collectors.partitioningBy(field -> field == null || field.trim().isEmpty())?