How to perform arithmetic on the result of Collectors.Counting()?
Given: List<Integer> myIntegers = Arrays.asList(1, 1, 2, 3, 4, 2); Return: an Integer = Sum(((Frequency of Integer) / 2))) I’m able to get the frequency of each integer using Collectors.groupingBy(), but want to then divide each frequency value by 2 and then sum all the values in the map, returning just an Integer: Map<Integer, Long>… Read More How to perform arithmetic on the result of Collectors.Counting()?