package com.brilliance.isc.convert.mt1xx;

import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.commontag.ActnoBicAdrTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt1xx.mt1XXAbsCreator.MT101AbsCreator;
import com.brilliance.isc.swift.objmtconvert.model.mt1xx.MT101Creator;
import org.junit.Test;
import java.util.LinkedList;
import java.util.List;

public class MT101Test {

    @Test
    public void MT101_Test(){
        MT101Creator mt101Creator = new MT101Creator("101");
        //20
        mt101Creator.setSendersReference("Sender");
        //21R
        mt101Creator.setCustomerSpecifiedReference("Customer");
        //28D
        mt101Creator.setMessageIndexTotal("12345/54321");
        //50a-C Instructing Party
        //101报文中的第一个50a域，此处调用了setBic()，为50C.
//        ActnoBicAdrTagXXX actnoBicAdrTag50aC = new ActnoBicAdrTagXXX("50","101");
//        actnoBicAdrTag50aC.setBic("IRVTUS3NXXX");
//        mt101Creator.setActnoBicAdrTag50a(actnoBicAdrTag50aC);
        //50a-L Instructing Party
        //101报文中第一个50a域，此处调用了setPartyIdentifier()，为50L.
        ActnoBicAdrTagXXX actnoBicAdrTag50aL = new ActnoBicAdrTagXXX("50", "101");
        actnoBicAdrTag50aL.setPartyIdentifier("/9020123100");
        mt101Creator.setInstructingParty(actnoBicAdrTag50aL);
        //50a2-F Ordering Customer
        //101报文中第二个50a域，此处调用了setPartyIdentifier()和setAddress(),
        // 并且setAddress()参数格式为4*(1!n/33x)，为50F.
        ActnoBicAdrTagXXX actnoBicAdrTag50a2F = new ActnoBicAdrTagXXX("50","101");
        actnoBicAdrTag50a2F.setPartyIdentifier("/actnoBicAdrTag56a9020123100");
        actnoBicAdrTag50a2F.setAddress("1/FINPETROL INC.\r\n2/ANDRELAE SPINKATU 7\r\n3/FI/HELSINKI");
        mt101Creator.setOrderingCustomer(actnoBicAdrTag50a2F);
        //50a2-G Ordering Customer
        //101报文中第二个50a域，此处调用了setAcctno()和setBic(), 为50G.
//        ActnoBicAdrTagXXX actnoBicAdrTag50a2G = new ActnoBicAdrTagXXX("50", "111");
//        actnoBicAdrTag50a2G.setAcctno("/50a2GAcc");
//        actnoBicAdrTag50a2G.setBic("HSBCHKHHHKH");
//        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2G);
        //50a2-H
        //101报文中第二个50a域，此处调用了setAcctno()和setAddress(),
        // 并且setAddress()参数格式为4*35x，为50H.
        ActnoBicAdrTagXXX actnoBicAdrTag50a2H = new ActnoBicAdrTagXXX("50", "101");
        actnoBicAdrTag50a2H.setAcctno("/50a2Hacc");
        actnoBicAdrTag50a2H.setAddress("1Counter\r\n2Province\r\n3City");
        mt101Creator.setOrderingCustomer(actnoBicAdrTag50a2H);
        //52a-A
        //101报文的52a域，此处调用了setBic(), 为52A.
        //setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX actnoBicAdrTag52aA = new ActnoBicAdrTagXXX("52");
        actnoBicAdrTag52aA.setPartyIdentifier("/9020123100");
        actnoBicAdrTag52aA.setBic("HSBCHKHHHKH");
        mt101Creator.setAccountServicingInstitution(actnoBicAdrTag52aA);
        //52a-C
        //101报文的52a域，此处只调用了setPartyIdentifier(), 为52C.
//        ActnoBicAdrTagXXX actnoBicAdrTag52aC = new ActnoBicAdrTagXXX("52");
//        actnoBicAdrTag52aC.setPartyIdentifier("/9020123100");
//        mt101Creator.setActnoBicAdrTag52a(actnoBicAdrTag52aC);
        //51A
        ActnoBicAdrTagXXX actnoBicAdrTag51A = new ActnoBicAdrTagXXX("51");
        actnoBicAdrTag51A.setInfo("D");
        actnoBicAdrTag51A.setPartyIdentifier("9020123300");
        actnoBicAdrTag51A.setBic("HSBCHKHHHKH");
        mt101Creator.setSendingInstitution(actnoBicAdrTag51A);
        //30
        mt101Creator.setRequestedExecutionDate("201231");
        //25
        mt101Creator.setAuthorisation("Author");

        //循环域
        List<MT101AbsCreator> list101 = new LinkedList<>();
        //循环1

        MT101AbsCreator cyc1 = new MT101AbsCreator("101");
        //21
        cyc1.setTransactionReference("REF501");
        //21F
        cyc1.setFXDealReference("UKNOWIT1234");
        //23E
        LinkedList<String> tagCyc1_23E = new LinkedList<>();
        tagCyc1_23E.add("URGP");
        tagCyc1_23E.add("CORT");
        cyc1.setInstructionCode(tagCyc1_23E);
        //32B
        cyc1.setCurrencyTransactionAmount("CNY1000,");
        //50a-C Instructing Party
        //101报文的循环域的第一个50a域，此处调用了setBic(), 为50C.
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50","101");
        cyc1ActnoBicAdrTag50a.setBic("IRVTUS3NXXX");
        cyc1.setInstructionParty(cyc1ActnoBicAdrTag50a);
        //50a2-H Ordering Customer
        //101报文的循环域的第二个50a域，此处调用了setAcctno()和setAddress(), 为50H.
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50","101");
        cyc1ActnoBicAdrTag50a2.setAddress("1/Acct\r\n2Acct\r\n3Acct");
        cyc1ActnoBicAdrTag50a2.setAcctno("/50a2cyc");
        cyc1.setOrderingCustomer(cyc1ActnoBicAdrTag50a2);
        //52a-A
        //101报文循环域的52a域，此处调用了setBic(), 为52A.
        //setPartyIdentifier()和setInfo()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
        cyc1ActnoBicAdrTag52a.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
        cyc1.setAccountServicingInstitution(cyc1ActnoBicAdrTag52a);
        //56a-A
        //101报文循环域的56a域，此处调用了setBic(), 为56A.
        //setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aA = new ActnoBicAdrTagXXX("56");
        cyc1ActnoBicAdrTag56aA.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag56aA.setBic("HSBCHKHHHKH");
        cyc1.setIntermediary(cyc1ActnoBicAdrTag56aA);
        //56a-C
        // 101报文循环域的56a域，此处只调用了setPartyIdentifier(), 为56C.
        // 暂时不测试
//        ActnoBicAdrTagXXX cyc1ActnoBicAdtTag56aC = new ActnoBicAdrTagXXX("56");
//        cyc1ActnoBicAdtTag56aC.setPartyIdentifier("/9020123200");
//        cyc1.setActnoBicAdrTag56a(cyc1ActnoBicAdtTag56aC);
        //56a-D
        // 101报文循环域的56a域，此处调用了setAddress(), 为56D.
        // setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aD = new ActnoBicAdrTagXXX("56");
        cyc1ActnoBicAdrTag56aD.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag56aD.setAddress("S7");
        cyc1.setIntermediary(cyc1ActnoBicAdrTag56aD);
        //57a-A
        // 101报文循环域的57a域，此处调用了setBic(), 为57A.
        // setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aA = new ActnoBicAdrTagXXX("57");
        cyc1ActnoBicAdrTag57aA.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag57aA.setBic("BARCHKHHXXX");
        cyc1.setAccountWithInstitution(cyc1ActnoBicAdrTag57aA);
        //57a-C
        // 101报文循环域的57a域，此处只调用了setPartyIdentifIer, 为57C.
        // 暂时不测试
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aC = new ActnoBicAdrTagXXX("57");
//        cyc1ActnoBicAdrTag57aC.setPartyIdentifier("/9020123200");
//        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aC);
        //57a-D
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aD = new ActnoBicAdrTagXXX("57");
//        cyc1ActnoBicAdrTag57aD.setPartyIdentifier("/9020123200");
//        cyc1ActnoBicAdrTag57aD.setAddress("1Province\r\n2\r\n3");
//        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aD);
        //59a
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
        cyc1ActnoBicAdrTag59a.setAcctno("CYC159A_ACCT");
        cyc1ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
        cyc1.setBeneficiary(cyc1ActnoBicAdrTag59a);
        //59a-A
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59aA = new ActnoBicAdrTagXXX("59");
//        cyc1ActnoBicAdrTag59aA.setAcctno("CYC159A_ACCT");
//        cyc1ActnoBicAdrTag59aA.setBic("HSBCHKHHHKH");
//        cyc1.setActnoBicAdrTag59a(cyc1ActnoBicAdrTag59aA);
        //70
        cyc1.setRemittanceInformation("Remittance Information");
        //77B
        cyc1.setRegulatoryReporting("Regulatory Reporting");
        //33B
        cyc1.setCurrencyOriginalOrderedAmount("CNY1000,");
        //71A
        cyc1.setDetailsOfCharges("BEN");
        //25A
        cyc1.setChargesAccount("/9101000123");
        //36
        cyc1.setExchangeRate("0,90");

        //循环2
        MT101AbsCreator cyc2 = new MT101AbsCreator("101");
        //21
        cyc2.setTransactionReference("REF502");
        //21F
        cyc2.setFXDealReference("UKNOWIT4321");
        //23E
        LinkedList<String> tagCyc2_23E = new LinkedList<>();
        tagCyc2_23E.add("CHQB");
        tagCyc2_23E.add("CMSW");
        cyc2.setInstructionCode(tagCyc2_23E);
        //32B
        cyc2.setCurrencyTransactionAmount("EUR1000,");
        //50a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50");
        cyc2ActnoBicAdrTag50a.setBic("PNBPUS3NNYC");
        cyc2.setInstructionParty(cyc2ActnoBicAdrTag50a);
        //50a2
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50");
        cyc2ActnoBicAdrTag50a2.setAcctno("Cyc2Acct");
        cyc2ActnoBicAdrTag50a2.setBic("BOFAUS3NXXX");
        cyc2.setOrderingCustomer(cyc2ActnoBicAdrTag50a2);
        //52a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
        cyc2ActnoBicAdrTag52a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
        cyc2.setAccountServicingInstitution(cyc2ActnoBicAdrTag52a);
        //56a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag56a = new ActnoBicAdrTagXXX("56");
        cyc2ActnoBicAdrTag56a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag56a.setBic("HSBCHKHHHKH");
        cyc2.setIntermediary(cyc2ActnoBicAdrTag56a);
        //57a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag57a = new ActnoBicAdrTagXXX("57");
        cyc2ActnoBicAdrTag57a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag57a.setBic("BARCHKHHXXX");
        cyc2.setAccountWithInstitution(cyc2ActnoBicAdrTag57a);
        //59a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
        cyc2ActnoBicAdrTag59a.setAcctno("cyc259A_ACCT");
        cyc2ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
        cyc2.setBeneficiary(cyc2ActnoBicAdrTag59a);
        //70
        cyc2.setRemittanceInformation("Remittance Information");
        //77B
        cyc2.setRegulatoryReporting("Regulatory Reporting");
        //33B
        cyc2.setCurrencyOriginalOrderedAmount("EUR1000,");
        //71A
        cyc2.setDetailsOfCharges("OUR");
        //25A
        cyc2.setChargesAccount("/9101000123");
        //36
        cyc2.setExchangeRate("0,99");

        list101.add(cyc1);
        list101.add(cyc2);

        mt101Creator.setCycleDomain(list101);

        MtCreatorManager.packMT(mt101Creator);
    }

    /**
     * 如果字段36中给出了汇率，则必须在字段21F中引用相应的外汇交易
     */
    @Test
    public void MT101_Test_C1(){
        MT101Creator mt101Creator = new MT101Creator("101");
        //20
        mt101Creator.setSendersReference("Sender");
        //21R
        mt101Creator.setCustomerSpecifiedReference("Customer");
        //28D
        mt101Creator.setMessageIndexTotal("12345/54321");
        //50a-C Instructing Party
        //101报文中的第一个50a域，此处调用了setBic()，为50C.
//        ActnoBicAdrTagXXX actnoBicAdrTag50aC = new ActnoBicAdrTagXXX("50","101");
//        actnoBicAdrTag50aC.setBic("IRVTUS3NXXX");
//        mt101Creator.setActnoBicAdrTag50a(actnoBicAdrTag50aC);
        //50a-L Instructing Party
        //101报文中第一个50a域，此处调用了setPartyIdentifier()，为50L.
        ActnoBicAdrTagXXX actnoBicAdrTag50aL = new ActnoBicAdrTagXXX("50", "101");
        actnoBicAdrTag50aL.setPartyIdentifier("/9020123100");
        mt101Creator.setInstructingParty(actnoBicAdrTag50aL);
        //50a2-F Ordering Customer
        //101报文中第二个50a域，此处调用了setPartyIdentifier()和setAddress(),
        // 并且setAddress()参数格式为4*(1!n/33x)，为50F.
//        ActnoBicAdrTagXXX actnoBicAdrTag50a2F = new ActnoBicAdrTagXXX("50","101");
//        actnoBicAdrTag50a2F.setPartyIdentifier("/actnoBicAdrTag56a9020123100");
//        actnoBicAdrTag50a2F.setAddress("1/FINPETROL INC.\r\n2/ANDRELAE SPINKATU 7\r\n3/FI/HELSINKI");
//        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2F);
        //50a2-G Ordering Customer
        //101报文中第二个50a域，此处调用了setAcctno()和setBic(), 为50G.
//        ActnoBicAdrTagXXX actnoBicAdrTag50a2G = new ActnoBicAdrTagXXX("50", "111");
//        actnoBicAdrTag50a2G.setAcctno("/50a2GAcc");
//        actnoBicAdrTag50a2G.setBic("HSBCHKHHHKH");
//        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2G);
        //50a2-H
        //101报文中第二个50a域，此处调用了setAcctno()和setAddress(),
        // 并且setAddress()参数格式为4*35x，为50H.
        ActnoBicAdrTagXXX actnoBicAdrTag50a2H = new ActnoBicAdrTagXXX("50", "101");
        actnoBicAdrTag50a2H.setAcctno("/50a2Hacc");
        actnoBicAdrTag50a2H.setAddress("1Counter\n" +
                "2Province\n" +
                "3City");
        mt101Creator.setOrderingCustomer(actnoBicAdrTag50a2H);
        //52a-A
        //101报文的52a域，此处调用了setBic(), 为52A.
        //setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX actnoBicAdrTag52aA = new ActnoBicAdrTagXXX("52");
        actnoBicAdrTag52aA.setPartyIdentifier("/9020123100");
        actnoBicAdrTag52aA.setBic("HSBCHKHHHKH");
        mt101Creator.setAccountServicingInstitution(actnoBicAdrTag52aA);
        //52a-C
        //101报文的52a域，此处只调用了setPartyIdentifier(), 为52C.
//        ActnoBicAdrTagXXX actnoBicAdrTag52aC = new ActnoBicAdrTagXXX("52");
//        actnoBicAdrTag52aC.setPartyIdentifier("/9020123100");
//        mt101Creator.setActnoBicAdrTag52a(actnoBicAdrTag52aC);
        //51A
        ActnoBicAdrTagXXX actnoBicAdrTag51A = new ActnoBicAdrTagXXX("51");
        actnoBicAdrTag51A.setBic("BKTRUS33XXX");
        mt101Creator.setSendingInstitution(actnoBicAdrTag51A);
        //30
        mt101Creator.setRequestedExecutionDate("201231");
        //25
        mt101Creator.setAuthorisation("Author");

        //循环域
        List<MT101AbsCreator> list101 = new LinkedList<>();
        //循环1

        MT101AbsCreator cyc1 = new MT101AbsCreator("101");
        //21
        cyc1.setTransactionReference("REF501");

        //36
        cyc1.setExchangeRate("0.009");
        //21F
        /*
         * 如果字段36中给出了汇率，则必须在字段21F中引用相应的外汇交易
         */

//        cyc1.setFXDealReference("UKNOWIT1234");



        //23E
        LinkedList<String> tagCyc1_23E = new LinkedList<>();
        tagCyc1_23E.add("URGP");
        tagCyc1_23E.add("CORT");
        cyc1.setInstructionCode(tagCyc1_23E);
        //32B
        cyc1.setCurrencyTransactionAmount("CNY1000,");
        //50a-C Instructing Party
        //101报文的循环域的第一个50a域，此处调用了setBic(), 为50C.
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50","101");
        cyc1ActnoBicAdrTag50a.setBic("IRVTUS3NXXX");
        cyc1.setInstructionParty(cyc1ActnoBicAdrTag50a);
        //50a2-H Ordering Customer
        //101报文的循环域的第二个50a域，此处调用了setAcctno()和setAddress(), 为50H.
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50","101");
        cyc1ActnoBicAdrTag50a2.setAddress("1/Acct\r\n2Acct\r\n3Acct");
        cyc1ActnoBicAdrTag50a2.setAcctno("/50a2cyc");
        cyc1.setOrderingCustomer(cyc1ActnoBicAdrTag50a2);
        //52a-A
        //101报文循环域的52a域，此处调用了setBic(), 为52A.
        //setPartyIdentifier()和setInfo()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
        cyc1ActnoBicAdrTag52a.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
        cyc1.setAccountServicingInstitution(cyc1ActnoBicAdrTag52a);
        //56a-A
        //101报文循环域的56a域，此处调用了setBic(), 为56A.
        //setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aA = new ActnoBicAdrTagXXX("56");
        cyc1ActnoBicAdrTag56aA.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag56aA.setBic("HSBCHKHHHKH");
        cyc1.setIntermediary(cyc1ActnoBicAdrTag56aA);
        //56a-C
        // 101报文循环域的56a域，此处只调用了setPartyIdentifier(), 为56C.
        // 暂时不测试
//        ActnoBicAdrTagXXX cyc1ActnoBicAdtTag56aC = new ActnoBicAdrTagXXX("56");
//        cyc1ActnoBicAdtTag56aC.setPartyIdentifier("/9020123200");
//        cyc1.setActnoBicAdrTag56a(cyc1ActnoBicAdtTag56aC);
        //56a-D
        // 101报文循环域的56a域，此处调用了setAddress(), 为56D.
        // setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aD = new ActnoBicAdrTagXXX("56");
        cyc1ActnoBicAdrTag56aD.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag56aD.setAddress("S7\r\nS2334\r\ndsfse5");
        cyc1.setIntermediary(cyc1ActnoBicAdrTag56aD);
        //57a-A
        // 101报文循环域的57a域，此处调用了setBic(), 为57A.
        // setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aA = new ActnoBicAdrTagXXX("57");
        cyc1ActnoBicAdrTag57aA.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag57aA.setBic("BARCHKHHXXX");
        cyc1.setAccountWithInstitution(cyc1ActnoBicAdrTag57aA);
        //57a-C
        // 101报文循环域的57a域，此处只调用了setPartyIdentifIer, 为57C.
        // 暂时不测试
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aC = new ActnoBicAdrTagXXX("57");
//        cyc1ActnoBicAdrTag57aC.setPartyIdentifier("/9020123200");
//        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aC);
        //57a-D
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aD = new ActnoBicAdrTagXXX("57");
//        cyc1ActnoBicAdrTag57aD.setPartyIdentifier("/9020123200");
//        cyc1ActnoBicAdrTag57aD.setAddress("1Province\r\n2\r\n3");
//        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aD);
        //59a
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
        cyc1ActnoBicAdrTag59a.setAcctno("CYC159A_ACCT");
        cyc1ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
        cyc1.setBeneficiary(cyc1ActnoBicAdrTag59a);
        //59a-A
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59aA = new ActnoBicAdrTagXXX("59");
//        cyc1ActnoBicAdrTag59aA.setAcctno("CYC159A_ACCT");
//        cyc1ActnoBicAdrTag59aA.setBic("HSBCHKHHHKH");
//        cyc1.setActnoBicAdrTag59a(cyc1ActnoBicAdrTag59aA);
        //70
        cyc1.setRemittanceInformation("Remittance Information");
        //77B
        cyc1.setRegulatoryReporting("Regulatory Reporting");
        //33B
        cyc1.setCurrencyOriginalOrderedAmount("CNY1000,");
        //71A
        cyc1.setDetailsOfCharges("BEN");
        //25A
        cyc1.setChargesAccount("/9101000123");


        //循环2
        MT101AbsCreator cyc2 = new MT101AbsCreator("101");
        //21
        cyc2.setTransactionReference("REF502");
        //21F
        cyc2.setFXDealReference("UKNOWIT4321");
        //23E
        LinkedList<String> tagCyc2_23E = new LinkedList<>();
        tagCyc2_23E.add("CHQB");
        tagCyc2_23E.add("CMSW");
        cyc2.setInstructionCode(tagCyc2_23E);
        //32B
        cyc2.setCurrencyTransactionAmount("EUR1000,");
        //50a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50");
        cyc2ActnoBicAdrTag50a.setBic("PNBPUS3NNYC");
        cyc2.setInstructionParty(cyc2ActnoBicAdrTag50a);
        //50a2
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50");
        cyc2ActnoBicAdrTag50a2.setAcctno("Cyc2Acct");
        cyc2ActnoBicAdrTag50a2.setBic("BOFAUS3NXXX");
        cyc2.setOrderingCustomer(cyc2ActnoBicAdrTag50a2);
        //52a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
        cyc2ActnoBicAdrTag52a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
        cyc2.setAccountServicingInstitution(cyc2ActnoBicAdrTag52a);
        //56a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag56a = new ActnoBicAdrTagXXX("56");
        cyc2ActnoBicAdrTag56a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag56a.setBic("HSBCHKHHHKH");
        cyc2.setIntermediary(cyc2ActnoBicAdrTag56a);
        //57a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag57a = new ActnoBicAdrTagXXX("57");
        cyc2ActnoBicAdrTag57a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag57a.setBic("BARCHKHHXXX");
        cyc2.setAccountWithInstitution(cyc2ActnoBicAdrTag57a);
        //59a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
        cyc2ActnoBicAdrTag59a.setAcctno("cyc259A_ACCT");
        cyc2ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
        cyc2.setBeneficiary(cyc2ActnoBicAdrTag59a);
        //70
        cyc2.setRemittanceInformation("Remittance Information");
        //77B
        cyc2.setRegulatoryReporting("Regulatory Reporting");
        //33B
        cyc2.setCurrencyOriginalOrderedAmount("EUR1000,");
        //71A
        cyc2.setDetailsOfCharges("OUR");
        //25A
        cyc2.setChargesAccount("/9101000123");
        //36
        cyc2.setExchangeRate("0,99");

        list101.add(cyc1);
        list101.add(cyc2);

        mt101Creator.setCycleDomain(list101);

        MtCreatorManager.packMT(mt101Creator);
    }

    /**
     * 在序列B的每次出现中，如果字段33B存在且字段32B中的“金额”不等于零，则字段36必须存在，否则不允许字段36
     */
//    @Test
//    public void MT101_Test_C2(){
//        MT101Creator mt101Creator = new MT101Creator("101");
//        //20
//        mt101Creator.setSendersReference("Sender");
//        //21R
//        mt101Creator.setCustomerSpecifiedReference("Customer");
//        //28D
//        mt101Creator.setMessageIndexTotal("12345/54321");
//        //50a-C Instructing Party
//        //101报文中的第一个50a域，此处调用了setBic()，为50C.
////        ActnoBicAdrTagXXX actnoBicAdrTag50aC = new ActnoBicAdrTagXXX("50","101");
////        actnoBicAdrTag50aC.setBic("IRVTUS3NXXX");
////        mt101Creator.setActnoBicAdrTag50a(actnoBicAdrTag50aC);
//        //50a-L Instructing Party
//        //101报文中第一个50a域，此处调用了setPartyIdentifier()，为50L.
//        ActnoBicAdrTagXXX actnoBicAdrTag50aL = new ActnoBicAdrTagXXX("50", "101");
//        actnoBicAdrTag50aL.setPartyIdentifier("/9020123100");
//        mt101Creator.setActnoBicAdrTag50a(actnoBicAdrTag50aL);
//        //50a2-F Ordering Customer
//        //101报文中第二个50a域，此处调用了setPartyIdentifier()和setAddress(),
//        // 并且setAddress()参数格式为4*(1!n/33x)，为50F.
////        ActnoBicAdrTagXXX actnoBicAdrTag50a2F = new ActnoBicAdrTagXXX("50","101");
////        actnoBicAdrTag50a2F.setPartyIdentifier("/actnoBicAdrTag56a9020123100");
////        actnoBicAdrTag50a2F.setAddress("1/FINPETROL INC.\r\n2/ANDRELAE SPINKATU 7\r\n3/FI/HELSINKI");
////        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2F);
//        //50a2-G Ordering Customer
//        //101报文中第二个50a域，此处调用了setAcctno()和setBic(), 为50G.
////        ActnoBicAdrTagXXX actnoBicAdrTag50a2G = new ActnoBicAdrTagXXX("50", "111");
////        actnoBicAdrTag50a2G.setAcctno("/50a2GAcc");
////        actnoBicAdrTag50a2G.setBic("HSBCHKHHHKH");
////        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2G);
//        //50a2-H
//        //101报文中第二个50a域，此处调用了setAcctno()和setAddress(),
//        // 并且setAddress()参数格式为4*35x，为50H.
//        ActnoBicAdrTagXXX actnoBicAdrTag50a2H = new ActnoBicAdrTagXXX("50", "101");
//        actnoBicAdrTag50a2H.setAcctno("/50a2Hacc");
//        actnoBicAdrTag50a2H.setAddress("1Counter\n" +
//                "2Province\n" +
//                "n3City");
//        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2H);
//        //52a-A
//        //101报文的52a域，此处调用了setBic(), 为52A.
//        //setInfo()和setPartyIdentifier()可选。
//        ActnoBicAdrTagXXX actnoBicAdrTag52aA = new ActnoBicAdrTagXXX("52");
//        actnoBicAdrTag52aA.setPartyIdentifier("/9020123100");
//        actnoBicAdrTag52aA.setBic("HSBCHKHHHKH");
//        mt101Creator.setActnoBicAdrTag52a(actnoBicAdrTag52aA);
//        //52a-C
//        //101报文的52a域，此处只调用了setPartyIdentifier(), 为52C.
////        ActnoBicAdrTagXXX actnoBicAdrTag52aC = new ActnoBicAdrTagXXX("52");
////        actnoBicAdrTag52aC.setPartyIdentifier("/9020123100");
////        mt101Creator.setActnoBicAdrTag52a(actnoBicAdrTag52aC);
//        //51A
//        mt101Creator.setSendingInstitution("/D/9020123300" +
//                "\nHSBCHKHHHKH");
//        //30
//        mt101Creator.setRequestedExecutionDate("201231");
//        //25
//        mt101Creator.setAuthorisation("Author");
//
//        //循环域
//        List<CycMT101Creator> list101 = new LinkedList<>();
//        //循环1
//
//        CycMT101Creator cyc1 = new CycMT101Creator("101");
//        //21
//        cyc1.setTransactionReference("REF501");
//        //21F
//        cyc1.setFXDealReference("UKNOWIT1234");
//        //23E
//        LinkedList<String> tagCyc1_23E = new LinkedList<>();
//        tagCyc1_23E.add("URGP");
//        tagCyc1_23E.add("CORT");
//        cyc1.setInstructionCode(tagCyc1_23E);
//        //32B
//        cyc1.setCurrencyTransactionAmount("CNY1000,");
//        //50a-C Instructing Party
//        //101报文的循环域的第一个50a域，此处调用了setBic(), 为50C.
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50","101");
//        cyc1ActnoBicAdrTag50a.setBic("IRVTUS3NXXX");
//        cyc1.setActnoBicAdrTag50a(cyc1ActnoBicAdrTag50a);
//        //50a2-H Ordering Customer
//        //101报文的循环域的第二个50a域，此处调用了setAcctno()和setAddress(), 为50H.
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50","101");
//        cyc1ActnoBicAdrTag50a2.setAddress("1/Acct\r\n2Acct\r\n3Acct");
//        cyc1ActnoBicAdrTag50a2.setAcctno("/50a2cyc");
//        cyc1.setActnoBicAdrTag50a2(cyc1ActnoBicAdrTag50a2);
//        //52a-A
//        //101报文循环域的52a域，此处调用了setBic(), 为52A.
//        //setPartyIdentifier()和setInfo()可选。
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
//        cyc1ActnoBicAdrTag52a.setPartyIdentifier("/9020123200");
//        cyc1ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
//        cyc1.setActnoBicAdrTag52a(cyc1ActnoBicAdrTag52a);
//        //56a-A
//        //101报文循环域的56a域，此处调用了setBic(), 为56A.
//        //setInfo()和setPartyIdentifier()可选。
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aA = new ActnoBicAdrTagXXX("56");
//        cyc1ActnoBicAdrTag56aA.setPartyIdentifier("/9020123200");
//        cyc1ActnoBicAdrTag56aA.setBic("HSBCHKHHHKH");
//        cyc1.setActnoBicAdrTag56a(cyc1ActnoBicAdrTag56aA);
//        //56a-C
//        // 101报文循环域的56a域，此处只调用了setPartyIdentifier(), 为56C.
//        // 暂时不测试
////        ActnoBicAdrTagXXX cyc1ActnoBicAdtTag56aC = new ActnoBicAdrTagXXX("56");
////        cyc1ActnoBicAdtTag56aC.setPartyIdentifier("/9020123200");
////        cyc1.setActnoBicAdrTag56a(cyc1ActnoBicAdtTag56aC);
//        //56a-D
//        // 101报文循环域的56a域，此处调用了setAddress(), 为56D.
//        // setInfo()和setPartyIdentifier()可选。
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aD = new ActnoBicAdrTagXXX("56");
//        cyc1ActnoBicAdrTag56aD.setPartyIdentifier("/9020123200");
//        cyc1ActnoBicAdrTag56aD.setAddress("S7");
//        cyc1.setActnoBicAdrTag56a(cyc1ActnoBicAdrTag56aD);
//        //57a-A
//        // 101报文循环域的57a域，此处调用了setBic(), 为57A.
//        // setInfo()和setPartyIdentifier()可选。
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aA = new ActnoBicAdrTagXXX("57");
//        cyc1ActnoBicAdrTag57aA.setPartyIdentifier("/9020123200");
//        cyc1ActnoBicAdrTag57aA.setBic("BARCHKHHXXX");
//        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aA);
//        //57a-C
//        // 101报文循环域的57a域，此处只调用了setPartyIdentifIer, 为57C.
//        // 暂时不测试
////        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aC = new ActnoBicAdrTagXXX("57");
////        cyc1ActnoBicAdrTag57aC.setPartyIdentifier("/9020123200");
////        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aC);
//        //57a-D
////        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aD = new ActnoBicAdrTagXXX("57");
////        cyc1ActnoBicAdrTag57aD.setPartyIdentifier("/9020123200");
////        cyc1ActnoBicAdrTag57aD.setAddress("1Province\r\n2\r\n3");
////        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aD);
//        //59a
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
//        cyc1ActnoBicAdrTag59a.setAcctno("CYC159A_ACCT");
//        cyc1ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
//        cyc1.setActnoBicAdrTag59a(cyc1ActnoBicAdrTag59a);
//        //59a-A
////        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59aA = new ActnoBicAdrTagXXX("59");
////        cyc1ActnoBicAdrTag59aA.setAcctno("CYC159A_ACCT");
////        cyc1ActnoBicAdrTag59aA.setBic("HSBCHKHHHKH");
////        cyc1.setActnoBicAdrTag59a(cyc1ActnoBicAdrTag59aA);
//        //70
//        cyc1.setRemittanceInformation("Remittance Information");
//        //77B
//        cyc1.setRegulatoryReporting("Regulatory Reporting");
//        //33B
//        cyc1.setCurrencyOriginalOrderedAmount("CNY1000,");
//        //71A
//        cyc1.setDetailsOfCharges("BEN");
//        //25A
//        cyc1.setChargesAccount("/9101000123");
//        //36
//        cyc1.setExchangeRate("0,90");
//
//        //循环2
//        CycMT101Creator cyc2 = new CycMT101Creator("101");
//        //21
//        cyc2.setTransactionReference("REF502");
//        //21F
//        cyc2.setFXDealReference("UKNOWIT4321");
//        //23E
//        LinkedList<String> tagCyc2_23E = new LinkedList<>();
//        tagCyc2_23E.add("CHQB");
//        tagCyc2_23E.add("CMSW");
//        cyc2.setInstructionCode(tagCyc2_23E);
//        //32B
//        cyc2.setCurrencyTransactionAmount("EUR1000,");
//        //50a
//        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50");
//        cyc2ActnoBicAdrTag50a.setBic("PNBPUS3NNYC");
//        cyc2.setActnoBicAdrTag50a(cyc2ActnoBicAdrTag50a);
//        //50a2
//        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50");
//        cyc2ActnoBicAdrTag50a2.setAcctno("Cyc2Acct");
//        cyc2ActnoBicAdrTag50a2.setBic("BOFAUS3NXXX");
//        cyc2.setActnoBicAdrTag50a2(cyc2ActnoBicAdrTag50a2);
//        //52a
//        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
//        cyc2ActnoBicAdrTag52a.setPartyIdentifier("9020123200");
//        cyc2ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
//        cyc2.setActnoBicAdrTag52a(cyc2ActnoBicAdrTag52a);
//        //56a
//        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag56a = new ActnoBicAdrTagXXX("56");
//        cyc2ActnoBicAdrTag56a.setPartyIdentifier("9020123200");
//        cyc2ActnoBicAdrTag56a.setBic("HSBCHKHHHKH");
//        cyc2.setActnoBicAdrTag56a(cyc2ActnoBicAdrTag56a);
//        //57a
//        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag57a = new ActnoBicAdrTagXXX("57");
//        cyc2ActnoBicAdrTag57a.setPartyIdentifier("9020123200");
//        cyc2ActnoBicAdrTag57a.setBic("BARCHKHHXXX");
//        cyc2.setActnoBicAdrTag57a(cyc2ActnoBicAdrTag57a);
//        //59a
//        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
//        cyc2ActnoBicAdrTag59a.setAcctno("cyc259A_ACCT");
//        cyc2ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
//        cyc2.setActnoBicAdrTag59a(cyc2ActnoBicAdrTag59a);
//        //70
//        cyc2.setRemittanceInformation("Remittance Information");
//        //77B
//        cyc2.setRegulatoryReporting("Regulatory Reporting");
//        //33B
//        cyc2.setCurrencyOriginalOrderedAmount("EUR1000,");
//        //71A
//        cyc2.setDetailsOfCharges("OUR");
//        //25A
//        cyc2.setChargesAccount("/9101000123");
//        //36
//        cyc2.setExchangeRate("0,99");
//
//        list101.add(cyc1);
//        list101.add(cyc2);
//
//        mt101Creator.setCycleDomain(list101);
//
//        MtCreatorManager.packMT(mt101Creator);
//    }

    /**
     * 如果只有一个借方账户，则必须按顺序A在字段50a（选项F、G或H）中标识订购客户。相反，如果使用了多个借方帐户，则必须针对字段50a中的每个交易标识它们
     */
    @Test
    public void MT101_Test_C3(){
        MT101Creator mt101Creator = new MT101Creator("101");
        //20
//        mt101Creator.setSendersReference("Sender");
        //21R
        mt101Creator.setCustomerSpecifiedReference("Customer");
        //28D
//        mt101Creator.setMessageIndexTotal("12345/54321");
        //50a-C Instructing Party
        //101报文中的第一个50a域，此处调用了setBic()，为50C.
//        ActnoBicAdrTagXXX actnoBicAdrTag50aC = new ActnoBicAdrTagXXX("50","101");
//        actnoBicAdrTag50aC.setBic("IRVTUS3NXXX");
//        mt101Creator.setActnoBicAdrTag50a(actnoBicAdrTag50aC);
        //50a-L Instructing Party
        //101报文中第一个50a域，此处调用了setPartyIdentifier()，为50L.
        ActnoBicAdrTagXXX actnoBicAdrTag50aL = new ActnoBicAdrTagXXX("50", "101");
        actnoBicAdrTag50aL.setPartyIdentifier("/9020123100");
        mt101Creator.setInstructingParty(actnoBicAdrTag50aL);
        //50a2-F Ordering Customer
        //101报文中第二个50a域，此处调用了setPartyIdentifier()和setAddress(),
        // 并且setAddress()参数格式为4*(1!n/33x)，为50F.
//        ActnoBicAdrTagXXX actnoBicAdrTag50a2F = new ActnoBicAdrTagXXX("50","101");
//        actnoBicAdrTag50a2F.setPartyIdentifier("/actnoBicAdrTag56a9020123100");
//        actnoBicAdrTag50a2F.setAddress("1/FINPETROL INC.\r\n2/ANDRELAE SPINKATU 7\r\n3/FI/HELSINKI");
//        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2F);
        //50a2-G Ordering Customer
        //101报文中第二个50a域，此处调用了setAcctno()和setBic(), 为50G.
//        ActnoBicAdrTagXXX actnoBicAdrTag50a2G = new ActnoBicAdrTagXXX("50", "111");
//        actnoBicAdrTag50a2G.setAcctno("/50a2GAcc");
//        actnoBicAdrTag50a2G.setBic("HSBCHKHHHKH");
//        mt101Creator.setActnoBicAdrTag50a2(actnoBicAdrTag50a2G);
        //50a2-H
        //101报文中第二个50a域，此处调用了setAcctno()和setAddress(),
        // 并且setAddress()参数格式为4*35x，为50H.
        ActnoBicAdrTagXXX actnoBicAdrTag50a2H = new ActnoBicAdrTagXXX("50", "101");
        actnoBicAdrTag50a2H.setAcctno("/50a2Hacc");
        actnoBicAdrTag50a2H.setAddress("1Counter\r\n2Province\r\n3City");
        mt101Creator.setOrderingCustomer(actnoBicAdrTag50a2H);
        //52a-A
        //101报文的52a域，此处调用了setBic(), 为52A.
        //setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX actnoBicAdrTag52aA = new ActnoBicAdrTagXXX("52");
        actnoBicAdrTag52aA.setPartyIdentifier("/9020123100");
        actnoBicAdrTag52aA.setBic("HSBCHKHHHKH");
        mt101Creator.setAccountServicingInstitution(actnoBicAdrTag52aA);
        //52a-C
        //101报文的52a域，此处只调用了setPartyIdentifier(), 为52C.
//        ActnoBicAdrTagXXX actnoBicAdrTag52aC = new ActnoBicAdrTagXXX("52");
//        actnoBicAdrTag52aC.setPartyIdentifier("/9020123100");
//        mt101Creator.setActnoBicAdrTag52a(actnoBicAdrTag52aC);
        //51A
        ActnoBicAdrTagXXX actnoBicAdrTag51ACyc1 = new ActnoBicAdrTagXXX("51");
        actnoBicAdrTag51ACyc1.setBic("BKTRUS33XXX");
        mt101Creator.setSendingInstitution(actnoBicAdrTag51ACyc1);
        //30
        mt101Creator.setRequestedExecutionDate("201231");
        //25
        mt101Creator.setAuthorisation("Author");

        //循环域
        List<MT101AbsCreator> list101 = new LinkedList<>();
        //循环1

        MT101AbsCreator cyc1 = new MT101AbsCreator("101");
        //21
        cyc1.setTransactionReference("REF501");
        //21F
        cyc1.setFXDealReference("UKNOWIT1234");
        //23E
        LinkedList<String> tagCyc1_23E = new LinkedList<>();
        tagCyc1_23E.add("URGP");
        tagCyc1_23E.add("CORT");
        cyc1.setInstructionCode(tagCyc1_23E);
        //32B
        cyc1.setCurrencyTransactionAmount("CNY1000,");
        //50a-C Instructing Party
        //101报文的循环域的第一个50a域，此处调用了setBic(), 为50C.
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50","101");
        cyc1ActnoBicAdrTag50a.setBic("IRVTUS3NXXX");
        cyc1.setInstructionParty(cyc1ActnoBicAdrTag50a);
        //50a2-H Ordering Customer
        //101报文的循环域的第二个50a域，此处调用了setAcctno()和setAddress(), 为50H.
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50","101");
        cyc1ActnoBicAdrTag50a2.setAddress("1/Acct\r\n2Acct\r\n3Acct");
        cyc1ActnoBicAdrTag50a2.setAcctno("/50a2cyc");
        cyc1.setOrderingCustomer(cyc1ActnoBicAdrTag50a2);
        //52a-A
        //101报文循环域的52a域，此处调用了setBic(), 为52A.
        //setPartyIdentifier()和setInfo()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
        cyc1ActnoBicAdrTag52a.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
        cyc1.setAccountServicingInstitution(cyc1ActnoBicAdrTag52a);
        //56a-A
        //101报文循环域的56a域，此处调用了setBic(), 为56A.
        //setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aA = new ActnoBicAdrTagXXX("56");
        cyc1ActnoBicAdrTag56aA.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag56aA.setBic("HSBCHKHHHKH");
        cyc1.setIntermediary(cyc1ActnoBicAdrTag56aA);
        //56a-C
        // 101报文循环域的56a域，此处只调用了setPartyIdentifier(), 为56C.
        // 暂时不测试
//        ActnoBicAdrTagXXX cyc1ActnoBicAdtTag56aC = new ActnoBicAdrTagXXX("56");
//        cyc1ActnoBicAdtTag56aC.setPartyIdentifier("/9020123200");
//        cyc1.setActnoBicAdrTag56a(cyc1ActnoBicAdtTag56aC);
        //56a-D
        // 101报文循环域的56a域，此处调用了setAddress(), 为56D.
        // setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag56aD = new ActnoBicAdrTagXXX("56");
        cyc1ActnoBicAdrTag56aD.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag56aD.setAddress("S7");
        cyc1.setIntermediary(cyc1ActnoBicAdrTag56aD);
        //57a-A
        // 101报文循环域的57a域，此处调用了setBic(), 为57A.
        // setInfo()和setPartyIdentifier()可选。
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aA = new ActnoBicAdrTagXXX("57");
        cyc1ActnoBicAdrTag57aA.setPartyIdentifier("/9020123200");
        cyc1ActnoBicAdrTag57aA.setBic("BARCHKHHXXX");
        cyc1.setAccountWithInstitution(cyc1ActnoBicAdrTag57aA);
        //57a-C
        // 101报文循环域的57a域，此处只调用了setPartyIdentifIer, 为57C.
        // 暂时不测试
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aC = new ActnoBicAdrTagXXX("57");
//        cyc1ActnoBicAdrTag57aC.setPartyIdentifier("/9020123200");
//        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aC);
        //57a-D
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag57aD = new ActnoBicAdrTagXXX("57");
//        cyc1ActnoBicAdrTag57aD.setPartyIdentifier("/9020123200");
//        cyc1ActnoBicAdrTag57aD.setAddress("1Province\r\n2\r\n3");
//        cyc1.setActnoBicAdrTag57a(cyc1ActnoBicAdrTag57aD);
        //59a
        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
        cyc1ActnoBicAdrTag59a.setAcctno("CYC159A_ACCT");
        cyc1ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
        cyc1.setBeneficiary(cyc1ActnoBicAdrTag59a);
        //59a-A
//        ActnoBicAdrTagXXX cyc1ActnoBicAdrTag59aA = new ActnoBicAdrTagXXX("59");
//        cyc1ActnoBicAdrTag59aA.setAcctno("CYC159A_ACCT");
//        cyc1ActnoBicAdrTag59aA.setBic("HSBCHKHHHKH");
//        cyc1.setActnoBicAdrTag59a(cyc1ActnoBicAdrTag59aA);
        //70
        cyc1.setRemittanceInformation("Remittance Information");
        //77B
        cyc1.setRegulatoryReporting("Regulatory Reporting");
        //33B
        cyc1.setCurrencyOriginalOrderedAmount("CNY1000,");
        //71A
        cyc1.setDetailsOfCharges("BEN");
        //25A
        cyc1.setChargesAccount("/9101000123");
        //36
        cyc1.setExchangeRate("0,90");

        //循环2
        MT101AbsCreator cyc2 = new MT101AbsCreator("101");
        //21
//        cyc2.setTransactionReference("REF502");
        //21F
        cyc2.setFXDealReference("UKNOWIT4321");
        //23E
        LinkedList<String> tagCyc2_23E = new LinkedList<>();
        tagCyc2_23E.add("CHQB");
        tagCyc2_23E.add("CMSW");
        cyc2.setInstructionCode(tagCyc2_23E);
        //32B
        cyc2.setCurrencyTransactionAmount("EUR1000,");
        //50a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a = new ActnoBicAdrTagXXX("50");
        cyc2ActnoBicAdrTag50a.setBic("PNBPUS3NNYC");
        cyc2.setInstructionParty(cyc2ActnoBicAdrTag50a);
        //50a2
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag50a2 = new ActnoBicAdrTagXXX("50");
        cyc2ActnoBicAdrTag50a2.setAcctno("Cyc2Acct");
        cyc2ActnoBicAdrTag50a2.setBic("BOFAUS3NXXX");
        cyc2.setOrderingCustomer(cyc2ActnoBicAdrTag50a2);
        //52a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
        cyc2ActnoBicAdrTag52a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag52a.setBic("HSBCHKHHHKH");
        cyc2.setAccountServicingInstitution(cyc2ActnoBicAdrTag52a);
        //56a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag56a = new ActnoBicAdrTagXXX("56");
        cyc2ActnoBicAdrTag56a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag56a.setBic("HSBCHKHHHKH");
        cyc2.setIntermediary(cyc2ActnoBicAdrTag56a);
        //57a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag57a = new ActnoBicAdrTagXXX("57");
        cyc2ActnoBicAdrTag57a.setPartyIdentifier("9020123200");
        cyc2ActnoBicAdrTag57a.setBic("BARCHKHHXXX");
        cyc2.setAccountWithInstitution(cyc2ActnoBicAdrTag57a);
        //59a
        ActnoBicAdrTagXXX cyc2ActnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
        cyc2ActnoBicAdrTag59a.setAcctno("cyc259A_ACCT");
        cyc2ActnoBicAdrTag59a.setAddress("1Country\r\n2Province\r\n3City");
        cyc2.setBeneficiary(cyc2ActnoBicAdrTag59a);
        //70
        cyc2.setRemittanceInformation("Remittance Information");
        //77B
        cyc2.setRegulatoryReporting("Regulatory Reporting");
        //33B
        cyc2.setCurrencyOriginalOrderedAmount("EUR1000,");
        //71A
        cyc2.setDetailsOfCharges("OUR");
        //25A
        cyc2.setChargesAccount("/9101000123");
        //36
        cyc2.setExchangeRate("0,99");

        list101.add(cyc1);
        list101.add(cyc2);

        mt101Creator.setCycleDomain(list101);

        MtCreatorManager.packMT(mt101Creator);
    }
}
