First calling the string.chars() which will return a IntStream. Using java 8 we can capture the number of upper case letters by using a predicate Character::isUpperCase and passing it to the filter method. Finally we will use the stream terminal operation count to find the total number of instances.