Java tutorial
//package com.java2s; import java.util.*; public class Main { /*** * * @param pressingLength model's length of pause between clicks (x) * @return Mx's values List, for My use ALPHA = 1 */ private static double M(Map<String, Long> pressingLength) { double x = 0; for (String key : pressingLength.keySet()) { x += pressingLength.get(key); } return x / pressingLength.size(); } }