Difference between map() and flatMap() with a real-world example.

Java 8 Interview Question and Answer