code: <E extends BaseClient> Observable<E> initialise(@NonNull final Application application, @NonNull final E instance, @NonNull final CallbackAdapter adapter) {
  
          if (state.compareAndSet(GlobalState.NOT_INITIALISED, GlobalState.INITIALISING)) {
  
              return init(application, adapter)
                      .concatMap(new Func1<Boolean, Observable<SessionData>>() {
                          @Override
                          public Observable<SessionData> call(Boolean state) {
                              return loadSession(state);
                          }
                      })
                      .doOnNext(session -> log.d(session != null ? "Comapi initialised with session profile id : " + session.getProfileId() : "Comapi initialisation with no session."))
                      .doOnError(e -> {
                          if (log != null) {
                              log.f("Error initialising ComapiImpl SDK. " + e.getMessage(), new ComapiException("Error initialising ComapiImpl SDK.", e));
                          }
                      })
                      .flatMap(session -> {
                          if (state.get() == GlobalState.SESSION_ACTIVE && config.isFcmEnabled()) {
                              return instance.service.updatePushToken()
                                      .doOnNext(sessionComapiResultPair -> log.d("Push token updated"))
                                      .doOnError(throwable -> log.f("Error updating push token", throwable))
                                      .map((Func1<Pair<SessionData, ComapiResult<Void>>, Object>) resultPair -> resultPair.first)
                                      .onErrorReturn(new Func1<Throwable, SessionData>() {
                                          @Override
                                          public SessionData call(Throwable throwable) {
                                              return session;
                                          }
                                      });
                          }
                          return Observable.fromCallable(() -> session);
                      })
                      .map(result -> instance);
  
          } else if (state.get() >= GlobalState.INITIALISED) {
              return Observable.fromCallable(() -> instance);
          } else {
              return Observable.error(new ComapiException("Initialise in progress. Shouldn't be called twice. Ignoring."));
          }
      }
docs: Initialise ComapiImpl client instance.
  
  @param application Application context.
  @param instance    Client instance.
  @param adapter     Observables to callbacks adapter.
  @return Observable returning client instance.