StringUtils.split(topic.getFirstorgroup(), ",")
returns a list of 47 elements.
apiFormatBooleanTopic.setTopics(Sets.newHashSet(StringUtils.split(topics.getFirstorgroup(), ",") );
But when am trying to add them in the method method which accepts set, the value that are added to the object are only 28, i wonder why the remaining are missing.
A
Setcan not hold duplicated entries. When you add an entry which is already contained the old one is replaced. (Think of it as keys of aMap). It is considered as “contained” ifequals()of that object returns true.