In Java streams API i can make something like this:
someStream.stream()
.filter(someCondition)
.findFirst()
.map(someMappingStatement)
.orElse(null)
And i wan't to do the same code with sequences:
someSequence.asSequence()
.filter{ someCondition }
.map{ someMappingStatement }
.firstOrNull()
I have some worries about findFirst(). Because in sequences here i filter, then map all, but not first element. How can i rewrite it better in sequences?