Java collect with grouping and mapping to set, but empty set if all values are null

In my Java 11 application, I want to get Product Updates from a repository. One Product Update has a versionId and a list of productIds to update. If there are no product numbers that should be updated for update with versionId = X, I still want to write to another table that I've processed the update X. If there are updates present, they should be processed in the ProductProcessingService.

For now, the groupingBy and mapping give me a Set a null entry instead of an entry set, which is why...

Read More »

By: StackOverFlow - 7 days ago

Related Posts