Code example for TreeSet

Methods: addAll

0
                                // At this point the only thread modifying mInstalledApp is main 
                                int index = Collections.binarySearch(mInstalledPackages, item);
                                if (index < 0) {
                                    mInstalledPackages.add(-index - 1, item);
                                } else { 
                                    mInstalledPackages.get(index).activityTitles.addAll(item.activityTitles);
                                } 
                                notifyDataSetChanged();
                            } 
                        }); 
                    } 
                } 
            }).start();
        } 
 
        public PackageAdapter() { 
            reloadList(); 
        } 
 
        @Override 
        public int getCount() {