Java examples for Lambda Stream:IntStream
get Proper Divisors Sum via IntStream
//package com.java2s; import java.util.stream.IntStream; public class Main { public static int getProperDivisorsSum(int number) { return IntStream.range(1, (number / 2) + 1).filter(divisor -> number % divisor == 0).sum(); } }/*from w w w . j av a2 s.c o m*/