Applied Java: Streams

Exercise: Get Distinct List OF Subject

You have got a list of Students. You want to know in which Subjects students from your list participate in.

getDistinctListOfSubjects method currently returns an empty LinkedList. Use Streams to return the proper list of Subject without duplicates.

Need to use flatMap, which maps elements of the first stream (of students) to a stream of subjects (in this example). Uses distinct and then collects into a list