Stream api for getting maxX and maxY