Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Map; import org.joda.time.DateMidnight; public class Main { public static int[] getMaxAndSum(Map<DateMidnight, Integer> map) { int max = 0; int sum = 0; for (Integer count : map.values()) { sum += count; max = Math.max(max, count); } return new int[] { max, sum }; } }