Instantly share code, notes, and snippets.

@cajar1988 /hobby.scala Secret
Created Oct 30, 2015

Embed
What would you like to do?
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