I have two classes that are structured like this:
public class Company { private List person; ... public List getP
You can use lambda expression reduction to get the median of list:
Integer median = Person .stream() .map(Person::getAge) .filter(n -> n.length()/2);