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