I'm wondering if there is any significant difference between two cases of flatmapping.
Case 1:
someCollection
.stream()
.map(CollectionElement::getAnotherCollection)
.flatMap(Collection::stream);
Case 2:
someCollection
.stream()
.flatMap(element -> element.getAnotherCollection().stream());
Which one should be prefered? Is any of these better in terms of performance?