Double[] v = list.stream().map(item -> item.getRespTime()).toArray(Double[]::new); Mean mean = new Mean(); System.out.println(String.format("%.2f", mean.evaluate(ArrayUtils.toPrimitive(v))));
需要用到的jar包 common-lang-x-y.z.jar