void deviceDiscovered(final ScanResult result) {
        ExtendedBluetoothDevice device;

        final int index = indexOf(result);
        if (index == -1) {
            device = new ExtendedBluetoothDevice(result);
            mDevices.add(device);
            mUpdatedDeviceIndex = null;
        } else {
            device = mDevices.get(index);
            mUpdatedDeviceIndex = index;
        }
        // Update RSSI and name
        device.setRssi(result.getRssi());
        device.setName(getDeviceName(result));

        postValue(this);
    }
This class keeps the current list of discovered Bluetooth LE devices matching filter.
If a new device has been found it is added to the list and the LiveData in observers are
notified. If a packet from a device that's already in the list is found, the RSSI and name
are updated and observers are also notified. Observer may check {@link #getUpdatedDeviceIndex()}
to find out the index of the updated device.
app/src/main/java/no/nordicsemi/android/nrfmesh/viewmodels/ScannerLiveData.java