class WalletManager {

    public boolean isWalletAddressExists(String prefixAddress) {

        boolean isCacheExists = false;
        if (TextUtils.isEmpty(prefixAddress)) {
            return false;
        }

        if (mWalletList == null || mWalletList.isEmpty()) {
            return false;
        }

        for (Wallet walletEntity : mWalletList) {
            if (walletEntity.getPrefixAddress().toLowerCase().equals(prefixAddress.toLowerCase())) {
                isCacheExists = true;
                return true;
            }
        }

        if(!isCacheExists){
            Wallet wallet = WalletManager.getInstance().getWalletInfoByAddress(prefixAddress);
           if(wallet != null && (wallet.getPrefixAddress() != null && !wallet.getPrefixAddress().equals("")) &&
              wallet.getPrefixAddress().equals(prefixAddress)){

               return true;
           }
        }
        return false;


/*
        if (mWalletList == null || mWalletList.isEmpty()) {
            return false;
        }
        return Flowable
                .fromIterable(mWalletList)
                .map(new Function<Wallet, Boolean>() {
                    @Override
                    public Boolean apply(Wallet walletEntity) throws Exception {
                        return walletEntity.getPrefixAddress().toLowerCase().equalsIgnoreCase(prefixAddress.toLowerCase());
                    }
                })
                .filter(new Predicate<Boolean>() {
                    @Override
                    public boolean test(Boolean aBoolean) throws Exception {
                        return aBoolean;
                    }
                })
                .firstElement()
                .defaultIfEmpty(false)
                .blockingGet();*/

    }

    private  WalletManager();

}