Created
September 8, 2021 01:43
-
-
Save wkdalsgh192/4060272ce74aca3cac4cc83fe3cac363 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 void managingStateAndAction() { | |
List<Pay> pays = Arrays.asList( | |
new Pay(PAYPAL, 1000), | |
new Pay(VISA, 2000), | |
new Pay(MASTER_CARD, 3000), | |
new Pay(UNION_CARD, 5000) | |
); | |
Long totalSum = pays.stream().filter(pay -> pay.getPayType().equals(VISA)).mapToLong(Pay::getAmount).sum(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment