public boolean matches(ScanResultInterface scanResult) {
        if (scanResult == null) {
            return false;
        }
        String address = scanResult.getAddress();
        // Device match.
        if (mDeviceAddress != null && !mDeviceAddress.equals(address)) {
            return false;
        }

        ScanRecord scanRecord = scanResult.getScanRecord();

        // Local name match.
        if (mDeviceName != null) {
            if (!mDeviceName.equals(scanResult.getDeviceName())
                    && (scanRecord == null || !mDeviceName.equals(scanRecord.getDeviceName()))) {
                return false;
            }
        }

        // if scan record is null we cannot continue. For filter to pass, remaining filter properties must be empty
        if (scanRecord == null) {
            return mServiceUuid == null && mManufacturerData == null && mServiceData == null;
        }

        // UUID match.
        if (mServiceUuid != null && !matchesServiceUuids(mServiceUuid, mServiceUuidMask,
                scanRecord.getServiceUuids())) {
            return false;
        }

        // solicitation UUID match.
        if (mServiceSolicitationUuid != null && !matchesServiceSolicitationUuids(
                mServiceSolicitationUuid, mServiceSolicitationUuidMask,
                scanRecord.getServiceSolicitationUuids())) {
            return false;
        }

        // Service data match
        if (mServiceDataUuid != null) {
            if (!matchesPartialData(mServiceData, mServiceDataMask,
                    scanRecord.getServiceData(mServiceDataUuid))) {
                return false;
            }
        }

        // Manufacturer data match.
        if (mManufacturerId >= 0) {
            if (!matchesPartialData(mManufacturerData, mManufacturerDataMask,
                    scanRecord.getManufacturerSpecificData(mManufacturerId))) {
                return false;
            }
        }
        // All filters match.
        return true;
    }
Check if the scan filter matches a {@code scanResult}. A scan result is considered as a match
if it matches all the field filters.
rxandroidble/src/main/java/com/polidea/rxandroidble2/scan/ScanFilter.java