I have the below sample code.
List<MyItemsData.GroupItemInfo> itemsList = new ArrayList<>();
//some business logic to add the MyItemsData objects in the itemsList.
itemsList.stream().forEach(groupItemInfo -> {
if (groupItemInfo.getItems().isEmpty()) {
System.out.println("item is null");
} else {
System.out.println("item not null " + groupItemInfo.getItems().size());
}
if (!groupItemInfo.getItems().isEmpty()) {
}
});
I want to store all the items from all objects whose type!=null and should be unique(duplicates should not be allowed)