Closed antonu17 closed 4 years ago
Create new LinkedHashSet and populate it with 2 objects.
Set<Object> set = new LinkedHashSet<>(); set.add(new Object()); set.add(new Object());
Then make deep clone of if
Cloner cloner = new Cloner(); Set<Object> clone = cloner.deepClone(set);
And finnaly pick the first item and try to check if cloned set contains it (or even remove it from there)
Object first = clone.toArray()[0]; clone.contains(first); // returns false clone.remove(first); // also returns false and leave set unchanged
PS. It only affects java.util.LinkedHashSet, java.util.HashSet works well, as expected.
Create new LinkedHashSet and populate it with 2 objects.
Then make deep clone of if
And finnaly pick the first item and try to check if cloned set contains it (or even remove it from there)
PS. It only affects java.util.LinkedHashSet, java.util.HashSet works well, as expected.