code: @NonNull
      private static ObservableTransformer<byte[], PresenterEvent> transformToPresenterEvent(Type type) {
          return observable -> observable.map(writtenBytes -> ((PresenterEvent) new ResultEvent(writtenBytes, type)))
                  .onErrorReturn(throwable -> new ErrorEvent(throwable, type));
      }
docs: A convenience function creating a transformer that will wrap the emissions in either {@link ResultEvent} or {@link ErrorEvent}
  with a given {@link Type}
  
  @param type the type to wrap with
  @return transformer that will emit an observable that will be emitting ResultEvent or ErrorEvent with a given type