What does the `Stream.collect()` method do in Java?
The `Stream.collect()` method is a terminal operation that transforms the elements of the stream into a different form, such as a list, set, or map.
Exactly! `collect()` is a terminal operation that allows you to accumulate results into various collections.
Can you give an example of how to use `collect()` to create a `Map` from a stream of objects?