Let\'s assume that we have a list of countries: List and each country has a reference to a list of its regions: List
List
You could even use flatMap() like:
flatMap()
countries.stream().map(Country::getRegions).flatMap(List::stream).count(); where, map(Country::getRegions) = returns a Stream> flatMap(List::stream) = returns a Stream