Skip to content

Instantly share code, notes, and snippets.

@cajar1988
Created October 30, 2015 18:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cajar1988/361f4a6ab9543fac0a1f to your computer and use it in GitHub Desktop.
def notifyPersonsWithHobby(notificationService: NotificationService) =
fetchAll().filter(_.hobby != null).map(_.hobby).foreach(notificationService.sendInformation)
def notifyPersonsWithHobby_2(notificationService: NotificationService) =
fetchAll().foreach(person => Option(person.hobby).foreach(notificationService.sendInformation))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment