@Test(expected = GeneralSecurityException.class)
public void testLoadEncryptedPrivateKeyFromKeyStoreWithoutPassword() throws GeneralSecurityException, IOException {

    if (!x509TestContext.isKeyStoreEncrypted()) {
        throw new GeneralSecurityException(); // this case is not tested so throw the expected exception
    }
    PemReader.loadPrivateKey(x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM), Optional.empty());
}