ActionsGlobalTotalSummary (Map<String, ActionGlobalUsageInfo> statistics) { long maxCount = 0; long minCount = Long.MAX_VALUE; for (ActionGlobalUsageInfo value : statistics.values()) { long count = value.getUsagesCount(); maxCount = Math.max(count, maxCount); minCount = Math.min(count, minCount); } return new ActionsGlobalTotalSummary(maxCount, minCount); }