Program: 171875
Project: 171875
Buggy source:
public void getOrderBook(String amountAsset,String priceAsset){
  dataListener.showProgressDialog(R.string.please_wait,"String_Node_Str");
  compositeDisposable.add(MatherManager.get().getOrderBook(amountAsset,priceAsset).flatMap(orderBook -> {
    if (orderBook.pair.amountAsset.trim().equals(WAVES)) {
      return Observable.zip(Observable.just(new TransactionsInfo(WAVES,WAVES,8)),MatherManager.get().getTransactionsInfo(orderBook.pair.priceAsset),(BiFunction<TransactionsInfo,TransactionsInfo,Pair>)Pair::new);
    }
 else     if (orderBook.pair.priceAsset.trim().equals(WAVES)) {
      return Observable.zip(MatherManager.get().getTransactionsInfo(orderBook.pair.amountAsset),Observable.just(new TransactionsInfo(WAVES,WAVES,8)),(BiFunction<TransactionsInfo,TransactionsInfo,Pair>)Pair::new);
    }
 else {
      return Observable.zip(MatherManager.get().getTransactionsInfo(orderBook.pair.amountAsset),MatherManager.get().getTransactionsInfo(orderBook.pair.priceAsset),(BiFunction<TransactionsInfo,TransactionsInfo,Pair>)Pair::new);
    }
  }
).map(pair -> {
    TransactionsInfo amount=(TransactionsInfo)pair.first;
    TransactionsInfo price=(TransactionsInfo)pair.second;
    return new Market(amount.assetId,amount.name,price.assetId,price.name,new AmountAssetInfo(amount.decimals),new PriceAssetInfo(price.decimals));
  }
).map(market -> {
    DBHelper.getInstance().getRealm().executeTransaction(realm -> {
      RealmResults<Market> realmResults=realm.where(Market.class).equalTo("String_Node_Str",market.amountAsset).equalTo("String_Node_Str",market.priceAsset).findAll();
      if (realmResults.isEmpty())       realm.copyToRealm(market);
    }
);
    return market;
  }
).compose(RxUtil.applySchedulersToObservable()).subscribe(market -> {
    if (dataListener != null) {
      dataListener.dismissProgressDialog();
      dataListener.afterSuccessfullyOrderBook(market);
    }
  }
,throwable -> {
    Error response=((RetrofitException)throwable).getErrorBodyAs(Error.class);
    if (dataListener != null) {
      dataListener.dismissProgressDialog();
      dataListener.onShowToast(response.message,ToastCustom.TYPE_ERROR);
    }
  }
));
}

Fixed version (ground truth):
public void getOrderBook(String amountAsset,String priceAsset){
  dataListener.showProgressDialog(R.string.please_wait,"String_Node_Str");
  compositeDisposable.add(MatherManager.get().getOrderBook(amountAsset,priceAsset).flatMap(orderBook -> {
    if (orderBook.pair.amountAsset.trim().equals(WAVES)) {
      return Observable.zip(Observable.just(new TransactionsInfo(WAVES,WAVES,8)),NodeManager.get().getTransactionsInfo(orderBook.pair.priceAsset),(BiFunction<TransactionsInfo,TransactionsInfo,Pair>)Pair::new);
    }
 else     if (orderBook.pair.priceAsset.trim().equals(WAVES)) {
      return Observable.zip(NodeManager.get().getTransactionsInfo(orderBook.pair.amountAsset),Observable.just(new TransactionsInfo(WAVES,WAVES,8)),(BiFunction<TransactionsInfo,TransactionsInfo,Pair>)Pair::new);
    }
 else {
      return Observable.zip(NodeManager.get().getTransactionsInfo(orderBook.pair.amountAsset),NodeManager.get().getTransactionsInfo(orderBook.pair.priceAsset),(BiFunction<TransactionsInfo,TransactionsInfo,Pair>)Pair::new);
    }
  }
).map(pair -> {
    TransactionsInfo amount=(TransactionsInfo)pair.first;
    TransactionsInfo price=(TransactionsInfo)pair.second;
    return new Market(amount.assetId,amount.name,price.assetId,price.name,new AmountAssetInfo(amount.decimals),new PriceAssetInfo(price.decimals));
  }
).map(market -> {
    DBHelper.getInstance().getRealm().executeTransaction(realm -> {
      RealmResults<Market> realmResults=realm.where(Market.class).equalTo("String_Node_Str",market.amountAsset).equalTo("String_Node_Str",market.priceAsset).findAll();
      if (realmResults.isEmpty())       realm.copyToRealm(market);
    }
);
    return market;
  }
).compose(RxUtil.applySchedulersToObservable()).subscribe(market -> {
    if (dataListener != null) {
      dataListener.dismissProgressDialog();
      dataListener.afterSuccessfullyOrderBook(market);
    }
  }
,throwable -> {
    Error response=((RetrofitException)throwable).getErrorBodyAs(Error.class);
    if (dataListener != null) {
      dataListener.dismissProgressDialog();
      dataListener.onShowToast(response.message,ToastCustom.TYPE_ERROR);
    }
  }
));
}