SetNetworkListAdapter extends AbstractListAdapter<Network> { public void sort(Comparator comparator) { networks.sort(comparator); } SetNetworkListAdapter(final Context context, final int rowLayout); void clearWifiAndCell(); void clearWifi(); void clearCell(); void clearBluetooth(); void clearBluetoothLe(); void morphBluetoothToLe(Network n); void clear(); @Override void add(Network network); void addWiFi(Network n); void addCell(Network n); void addBluetooth(Network n); void addBluetoothLe(Network n); void enqueueBluetooth(Network n); void enqueueBluetoothLe(Network n); void batchUpdateBt(final boolean showCurrent, final boolean updateLe, final boolean updateClassic); @Override boolean isEmpty(); @Override int getCount(); @Override Network getItem(int pPosition); @Override long getItemId(int pPosition); @Override boolean hasStableIds(); void sort(Comparator comparator); @Override View getView(final int position, final View convertView, final ViewGroup parent);  }
@Test public void testLargeSets() { SetBackedNetworkList netlist = new SetBackedNetworkList(); System.out.print("Inserting Large Sets into SetBackedNetworkList..."); long start = System.currentTimeMillis(); netlist.addAll(wifiLarge); netlist.addAll(cellLarge); netlist.addAll(btcLarge); netlist.addAll(btleLarge); long end = System.currentTimeMillis(); System.out.println(" Inserted in ("+(end-start)+"ms)"); System.out.print("Sorting SetBackedNetworkList by signal..."); start = System.currentTimeMillis(); Collections.sort(netlist, NetworkListSorter.signalCompare); end = System.currentTimeMillis(); System.out.println(" Sorted in ("+(end-start)+"ms)"); System.out.print("Sorting SetBackedNetworkList by channel..."); start = System.currentTimeMillis(); Collections.sort(netlist, NetworkListSorter.channelCompare); end = System.currentTimeMillis(); System.out.println(" Sorted in ("+(end-start)+"ms)"); System.out.print("Sorting SetBackedNetworkList by encryption ..."); start = System.currentTimeMillis(); Collections.sort(netlist, NetworkListSorter.cryptoCompare); end = System.currentTimeMillis(); System.out.println(" Sorted in ("+(end-start)+"ms)"); System.out.print("Sorting SetBackedNetworkList by time found ..."); start = System.currentTimeMillis(); Collections.sort(netlist, NetworkListSorter.findTimeCompare); end = System.currentTimeMillis(); System.out.println(" Sorted in ("+(end-start)+"ms)"); System.out.print("Merging smaller sets..."); start = System.currentTimeMillis(); netlist.addAll(wifiSmall); netlist.addAll(cellSmall); netlist.addAll(btcSmall); netlist.addAll(btleSmall); end = System.currentTimeMillis(); System.out.println(" Inserted in ("+(end-start)+"ms)"); }