package test; import java.util.Arrays; public class Test { public static void main(String[] args) { System.out.println(Arrays.asList(1, 2, 3, 4, 5, 6).stream().mapToInt(Integer::intValue).average().getAsDouble()); } }