Created
September 25, 2020 08:04
-
-
Save zivce/c3750840d0c4c9f20d2e56f9c2498aae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Optional.ofNullable(discounts) | |
.map(Collection::stream) | |
.orElseGet(Stream::empty) | |
.map(DiscountValue::getAppliedValue) | |
.reduce(itemPrice, (price, discount) -> price - discount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment