### Question:
NfcUtils { public static byte[] changePin(NfcTranceiver card, byte[] currentPin, byte[] newPin) throws IOException, NfcCardException { selectApplication(card); if (currentPin != null && currentPin.length > 0) { if (!verifyPin(card, currentPin)) { return new byte[]{}; } } ChangePinApdu apdu = new ChangePinApdu(currentPin, newPin); ResponseApdu resp = tranceive(card, apdu, "CHANGE PIN"); return resp.getData(); }  static GenerateSignatureResponseApdu generateSignature(NfcTranceiver card, int keyIndex,
                                                                  byte[] dataToSign, byte[] pin); static GetKeyInfoResponseApdu readPublicKeyOrCreateIfNotExists(NfcTranceiver card, int keyIndex); static boolean generateKeyFromSeed(NfcTranceiver card, byte[] seed, byte[] pin); static byte[] initializePinAndReturnPuk(NfcTranceiver card, byte[] pinBytes); static byte[] changePin(NfcTranceiver card, byte[] currentPin, byte[] newPin); static boolean unlockPin(NfcTranceiver card, byte[] puk); static boolean verifyPin(NfcTranceiver card, byte[] pin); static final byte[] AID_INFINEON_BLOCKCHAIN2GO; }### Answer:
@Test public void testChangePin() throws IOException, NfcCardException { when(nfcTranceiver.transceive(any())).thenReturn(new byte[]{0x04, 0x03, 0x02, 0x01, (byte) 0x90, 0x00}); final String responseApdu = bytesToHex(NfcUtils.changePin(nfcTranceiver, "1234".getBytes(StandardCharsets.UTF_8), "1337".getBytes(StandardCharsets.UTF_8))); assertEquals("04030201", responseApdu); }