Java 8 Streams : Add validation to avoid duplicate keys

后端 未结 0 1175
滥情空心
滥情空心 2021-01-30 04:56

The following code throws exception when it tries add a duplicate id. How can i modify the code to avoid duplicates?

return Optional.ofNullable(list)
   .isPresen         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题