class CardAccountHandler {

    public boolean areAccountsEqual(Xs2aCardAccountDetails aspspAccount, AccountReference tppAccount) {

        String aspspMaskedPan = aspspAccount.getMaskedPan();

        return isMaskedPanCorrespondsToValue(aspspMaskedPan, tppAccount.getMaskedPan()) ||
                   isMaskedPanCorrespondsToValue(aspspMaskedPan, tppAccount.getPan());
    }

}