@NonNull
    private static ObservableTransformer<Observable<byte[]>, PresenterEvent> transformToNotificationPresenterEvent(Type type) {
        return observableObservable -> observableObservable
                .flatMap(observable -> observable
                        .map(bytes -> ((PresenterEvent) new ResultEvent(bytes, type)))
                )
                .onErrorReturn(throwable -> new ErrorEvent(throwable, type));
    }
A convenience function creating a transformer that will wrap the emissions in either {@link ResultEvent} or {@link ErrorEvent}
with a given {@link Type} for notification type {@link Observable} (Observable<Observable<byte[]>>)

@param type the type to wrap with
@return the transformer
sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/advanced/Presenter.java