I have a method that should convert a list to an Option of an object, or None if the list is empty.
Option
None
def listToOption(myList: List[F
myList.headOption.map(_ => Bar(myList))