SyntaxFix
Write A Post
Hire A Developer
Questions
In this case u could use the org.apache.commons.lang3.StringUtilsand do
org.apache.commons.lang3.StringUtils
int nonEmptyStrings = s.filter(StringUtils::isNotEmpty).count();