How can I Use Collectors to collect in a ConcurrentHashMap instread of putting manually into ConcurrentHashMap
ConcurrentHashMap config
You can use Collectors.toConcurrentMap
Collectors.toConcurrentMap
results.stream() .flatMap(res -> res.getSeries().stream()) .flatMap(series -> series.getValues().stream()) .collect(Collectors.toConcurrentMap( vals -> vals.get(1).toString(), vals -> vals.get(2).toString()));