public static <C> Collection<C> asList(final SparseArray<C> sparseArray) {
        if (sparseArray == null) return null;

        final Collection<C> arrayList = new ArrayList<>(sparseArray.size());
        for (int i = 0; i < sparseArray.size(); i++) {
            arrayList.add(sparseArray.valueAt(i));
        }

        return arrayList;
    }
As list.

@param <C>         the generic type
@param sparseArray the sparse array
@return the collection
library/src/main/java/dev/alt236/bluetoothlelib/device/adrecord/AdRecordStore.java