@Test
public void testGetX509CertificateHash() throws CertificateEncodingException {

    X509Certificate mockCert = Mockito.mock(X509Certificate.class);
    Mockito.when(mockCert.getEncoded()).thenThrow(new CryptoException());
    AccessToken accessToken = new AccessToken();
    assertNull(accessToken.getX509CertificateHash(mockCert));
}