The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Here is another solution... but it is using reduce.

employees
.filter(_.department == "IT")
.reduce((a, b) => if (a.age > b.age) a else b)
I suppose another option would be to apply the filter twice... once for the list of IT employees and the other to seed the foldLeft:

employees
.filter(_.department == "IT")
.foldLeft(employees.filter(_.department == "IT"smilie.head)((a, b) => if (a.age > b.age) a else b)

But these solutions are assuming there is at least one IT employee otherwise they will cause an exception.
Here is my solution:

employees
.filter(_.department == "IT")
.maxBy(_.age)

res0: Employee = Employee(Mary,32,IT)