private float[] calculateTimeToHomeRate(TimeToGoHome timeToGoHome) { if (timeToGoHome == null || timeToGoHome.isEmpty()) { return NumUtils.newEmptyFloatArray(RANGE_DIVIDER); } final int testCount = timeToGoHome.getTestCount(); final int range = testCount / RANGE_DIVIDER; final int[] occ = NumUtils.newEmptyIntArray(RANGE_DIVIDER); for (int i = 0; i < timeToGoHome.size(); i++) { final int index = timeToGoHome.get(i) / range; occ[index]++; } return NumUtils.calculateProbability(occ); }