Day Tokyo 2013. © JJUG 4 import java.math.BigDecimal; import java.util.Arrays; public class BalanceSheet { public BigDecimal asset, liabilities, equity; public BalanceSheet(BigDecimal asset, BigDecimal liabilities, BigDecimal equity) { this.asset = asset; this.liabilities = liabilities; this.equity = equity; } public static void main(String... args) { long c = Arrays.asList( new BalanceSheet(new BigDecimal("100"), new BigDecimal(50.75f), new BigDecimal("49.25")), new BalanceSheet(new BigDecimal("10000"), new BigDecimal(5_075), new BigDecimal(4_925.0))) .stream() .parallel() .filter(bs -> bs.asset.equals(bs.equity.add(bs.liabilities))) .count(); System.out.println(c); } } Java SE 8: Balance Sheet 1) 0 2) 1 3) 2 4) ෆఆ