@Test
public void testFCIparser_FCI_BadTags() {

  String dfName = "00112233445566778899";
  String appSerialNumber = "AABBCCDDEEFF0011";
  byte siBufferSizeIndicator = 11;
  byte siPlatform = (byte) 0x55;
  byte siApplicationType = (byte) 0xAA;
  byte siApplicationSubtype = (byte) 0x55;
  byte siSoftwareIssuer = (byte) 0xAA;
  byte siSoftwareVersion = (byte) 0x55;
  byte siSoftwareRevision = (byte) 0xAA;
  String startupInformation =
      String.format(
          "%02X%02X%02X%02X%02X%02X%02X",
          siBufferSizeIndicator,
          siPlatform,
          siApplicationType,
          siApplicationSubtype,
          siSoftwareIssuer,
          siSoftwareVersion,
          siSoftwareRevision);
  /* bad tag FCI Template (not constructed) */
  ApduResponse apduResponse =
      new ApduResponse(
          ByteArrayUtil.fromHex(
              "4F 24 84 0A "
                  + dfName
                  + " A5 16 BF0C 13 C7 08 "
                  + appSerialNumber
                  + " 53 07 "
                  + startupInformation
                  + "9000"),
          null);
  GetDataFciRespPars parser = new GetDataFciRespPars(apduResponse, null);
  /* invalid Calypso FCI */
  Assert.assertFalse(parser.isValidCalypsoFCI());
  /* bad tag DF Name (constructed) */
  apduResponse =
      new ApduResponse(
          ByteArrayUtil.fromHex(
              "6F 24 C4 0A "
                  + dfName
                  + " A5 16 BF0C 13 C7 08 "
                  + appSerialNumber
                  + " 53 07 "
                  + startupInformation
                  + "9000"),
          null);
  parser = new GetDataFciRespPars(apduResponse, null);
  /* invalid Calypso FCI */
  Assert.assertFalse(parser.isValidCalypsoFCI());
  /* bad tag FCI Proprietary Template (not constructed) */
  apduResponse =
      new ApduResponse(
          ByteArrayUtil.fromHex(
              "6F 24 84 0A "
                  + dfName
                  + " 85 16 BF0C 13 C7 08 "
                  + appSerialNumber
                  + " 53 07 "
                  + startupInformation
                  + "9000"),
          null);
  parser = new GetDataFciRespPars(apduResponse, null);
  /* invalid Calypso FCI */
  Assert.assertFalse(parser.isValidCalypsoFCI());
  /* bad tag FCI Issuer Discretionary */
  apduResponse =
      new ApduResponse(
          ByteArrayUtil.fromHex(
              "6F 24 84 0A "
                  + dfName
                  + " A5 16 BF0D 13 C7 08 "
                  + appSerialNumber
                  + " 53 07 "
                  + startupInformation
                  + "9000"),
          null);
  parser = new GetDataFciRespPars(apduResponse, null);
  /* invalid Calypso FCI */
  Assert.assertFalse(parser.isValidCalypsoFCI());
  /* bad tag Application Serial Number */
  apduResponse =
      new ApduResponse(
          ByteArrayUtil.fromHex(
              "6F 24 84 0A "
                  + dfName
                  + " A5 16 BF0C 13 87 08 "
                  + appSerialNumber
                  + " 53 07 "
                  + startupInformation
                  + "9000"),
          null);
  parser = new GetDataFciRespPars(apduResponse, null);
  /* invalid Calypso FCI */
  Assert.assertFalse(parser.isValidCalypsoFCI());
  /* bad tag Discretionary Data */
  apduResponse =
      new ApduResponse(
          ByteArrayUtil.fromHex(
              "6F 24 84 0A "
                  + dfName
                  + " A5 16 BF0C 13 C7 08 "
                  + appSerialNumber
                  + " 43 07 "
                  + startupInformation
                  + "9000"),
          null);
  parser = new GetDataFciRespPars(apduResponse, null);
  /* invalid Calypso FCI */
  Assert.assertFalse(parser.isValidCalypsoFCI());
}