Created
September 8, 2021 01:25
-
-
Save wkdalsgh192/7c7bc80e85b3defcd9615b97ba4b9911 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class Orders { | |
private final List<Order> orders; | |
public Orders(List<Order> orders) { | |
this.orders = orders; | |
} | |
public long getAmountSum() { | |
return orders.stream() | |
.mapToLong(Order::getAmount) | |
.sum(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment