Comment on Reduce operation in Java 8Comments−ajanuary11yStream already has a max method: return listOfTxnAmounts.stream().max(BigDecimal::compareTo).orElse(BigDecimal.ZERO); (They behave differently for a list that only has negative numbers, but it seems like that isn't a part of the domain anyway)
Comments
Stream already has a max method:
(They behave differently for a list that only has negative numbers, but it seems like that isn't a part of the domain anyway)