I was wondering, whether it is better (in a way of having clean code according to a best practice) to pass function as reference using a new code block (lambda expression) or using a callable reference to an existing declaration, whenever it is possible.
So it is better to use
jobRepository.findAll(spec).map(Job::toDto)
or
jobRepository.findAll(spec).map { it.toDto() }