Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set<MyObject> set = new HashSet<MyObject>() {
- @Override
- public boolean add(MyObject o) {
- if (this.contains(o)) {
- super.remove(o);
- }
- return super.add(o);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement