code: private Observable<ShutdownStatus> wrapShutdown(Observable<Boolean> source, final String target) {
          return source.
                  reduce(true, new Func2<Boolean, Boolean, Boolean>() {
                      @Override
                      public Boolean call(Boolean previousStatus, Boolean currentStatus) {
                          return previousStatus && currentStatus;
                      }
                  })
                  .map(new Func1<Boolean, ShutdownStatus>() {
                      @Override
                      public ShutdownStatus call(Boolean status) {
                          return new ShutdownStatus(target, status, null);
                      }
                  })
                  .onErrorReturn(new Func1<Throwable, ShutdownStatus>() {
                      @Override
                      public ShutdownStatus call(Throwable throwable) {
                          return new ShutdownStatus(target, false, throwable);
                      }
                  })
                  .doOnNext(new Action1<ShutdownStatus>() {
                      @Override
                      public void call(ShutdownStatus shutdownStatus) {
                          LOGGER.info(shutdownStatus.toString());
                      }
                  });
      }
docs: This method wraps an Observable of Boolean (for shutdown hook) into an Observable of ShutdownStatus.
  It will log each status with a short message indicating which target has been shut down, and the result of
  the call.