Integer totalHeight = characters
.stream()
.mapToInt(Person::getHeight)
.sum();
//using reduce
Integer heightSum = characters.stream()
.reduce(0,(height,person)->height+person.getHeight(),Integer::sum);
System.out.printf("total height %d",heightSum);