### Question:
AuthenticationToken { public boolean verifySignature(final ApnsVerificationKey verificationKey) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException { if (!this.header.getKeyId().equals(verificationKey.getKeyId())) { return false; } if (!this.claims.getIssuer().equals(verificationKey.getTeamId())) { return false; } final byte[] headerAndClaimsBytes; final String headerJson = JsonSerializer.writeJsonTextAsString(this.header.toMap()); final String claimsJson = JsonSerializer.writeJsonTextAsString(this.claims.toMap()); final String encodedHeaderAndClaims = encodeUnpaddedBase64UrlString(headerJson.getBytes(StandardCharsets.US_ASCII)) + '.' + encodeUnpaddedBase64UrlString(claimsJson.getBytes(StandardCharsets.US_ASCII)); headerAndClaimsBytes = encodedHeaderAndClaims.getBytes(StandardCharsets.US_ASCII); final Signature signature = Signature.getInstance(ApnsKey.APNS_SIGNATURE_ALGORITHM); signature.initVerify(verificationKey); signature.update(headerAndClaimsBytes); return signature.verify(this.signatureBytes); } AuthenticationToken(final ApnsSigningKey signingKey, final Instant issuedAt);  AuthenticationToken(final String base64EncodedToken); Instant getIssuedAt(); String getKeyId(); String getTeamId(); boolean verifySignature(final ApnsVerificationKey verificationKey); AsciiString getAuthorizationHeader(); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj);  }### Answer:
@Test void testVerifySignature() throws Exception { final AuthenticationToken token = new AuthenticationToken(this.signingKey, Instant.now()); assertTrue(token.verifySignature(this.verificationKey)); { final ApnsVerificationKey keyWithWrongKeyId = new ApnsVerificationKey(KEY_ID + "NOPE", TEAM_ID, this.verificationKey); assertFalse(token.verifySignature(keyWithWrongKeyId)); } { final ApnsVerificationKey keyWithWrongTeamId = new ApnsVerificationKey(KEY_ID, TEAM_ID + "NOPE", this.verificationKey); assertFalse(token.verifySignature(keyWithWrongTeamId)); } { final KeyPair keyPair = KeyPairUtil.generateKeyPair(); final ApnsVerificationKey keyWithWrongPublicKey = new ApnsVerificationKey(KEY_ID, TEAM_ID, (ECPublicKey) keyPair.getPublic()); assertFalse(token.verifySignature(keyWithWrongPublicKey)); } }