public static Optional < Playlist > getPlaylist ( EventModel eventModel ) { if ( eventModel . getListResourceContainer ( ) . containsResourcesFromSource ( ID ) ) { return eventModel . getListResourceContainer ( ) . provideResource ( ID ) . stream ( ) . findAny ( ) . flatMap ( Playlist :: importResource ) ; } else { return Optional . empty ( ) ; } }
gets the first playlist if found in the EventModel