private static Observable<PresenterEvent> setupWritingBehaviour(Observable<byte[]> writeClicks,
                                                                    BluetoothGattCharacteristic characteristic,
                                                                    RxBleConnection connection) {
        // basically the same logic as in the reads
        return !hasProperty(characteristic, BluetoothGattCharacteristic.PROPERTY_WRITE)
                ? Observable.empty()
                : writeClicks // with exception that clicks emit byte[] to write
                .flatMapSingle(bytes -> connection.writeCharacteristic(characteristic, bytes))
                .compose(transformToPresenterEvent(Type.WRITE));
    }
Presenter class for {@link AdvancedCharacteristicOperationExampleActivity}. Prepares the logic for the activity using passed
{@link Observable}s. Contains only static methods to show a purely reactive (stateless) approach.
<p>
The contract of the class is that it subscribes to the passed Observables only if a specific functionality is possible to use.
sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/advanced/Presenter.java