Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { Arrays.stream(new int[] { 1, 2, 3 }).map(n -> 2 * n + 1).average().ifPresent(System.out::println); } }