Java Code Like :
List DbDetails = ... Like 50000 rows records Map> details = new HashMap(); DbDetails .parallel
HashMap is not thread-safe, so don't use parallel streams with it.
HashMap
Besides, why do that there, when streams can do it for you?
DbDetails.parallelStream().collect(Collectors.groupingBy(Detail::getId))