I am using stream group by like this in Java 8:
reportProfitResult = reportProfits.stream()
.collect(Collectors.groupingBy(ReportProfitAnalysis::getStatisticTime));
Now I want to pass the group by field as a parameter in outer founction like this:
private void MapResult(E groupByField) {
reportProfitResult = reportProfits.stream()
.collect(Collectors.groupingBy(groupByField));
}
what should I do to make it work as expect ? I have followed tips but still encount this problem:
