The Best Advanced Java Books

I’ve spent some time trying to find technical books that are good next level reading after classics like Effective Java and Design Patterns (Gang of Four). These books are must reads for any engineer that is serious about improving their skills, but where should a Java developer look to after these? Below are a few more advanced books that I’ve found especially useful for Java software construction. Note: purchasing items through these links supports this website.

See recommended advanced Java books…

Simplify Code by Encapsulating Collections

A quick survey: Below are two methods that return school district ratings given a list of houses. Which method do you find more to the point?

Method A
public List<Rating> getDistrictRatings(List<House> houses, Price maxPrice) {
  Set<SchoolDistrict> districts = houses.stream()
      .filter(house -> house.price().isLessThan(maxPrice))
      .map(house -> house.getSchoolDistrict())
      .collect(Collectors.toSet());

  return ratingService.rateDistricts(districts);
}
Method B
public List<Rating> getDistrictRatings(Houses houses, Price maxPrice) {
  Set<SchoolDistrict>=> districts = houses.below(maxPrice)
      .getSchoolDistricts();
  return ratingService.rateDistricts(districts);
}

How to achieve the cleaner method…