### Question:
Identity { public void deleteIdentity(String password) { if (!this.keystore.verifyPassword(password)) { throw new TokenException(Messages.WALLET_INVALID_PASSWORD); } if (WalletManager.cleanKeystoreDirectory()) { WalletManager.clearKeystoreMap(); currentIdentity = null; } } private  Identity(IdentityKeystore keystore); private  Identity(Metadata metadata, List<String> mnemonicCodes, String password); String getIdentifier(); String getIpfsId(); List<Wallet> getWallets(); Metadata getMetadata(); static Identity getCurrentIdentity(); static Identity createIdentity(String name, String password, String passwordHit, String network, String segWit); static Identity recoverIdentity(String mnemonic, String name, String password,
                                         String passwordHit, String network, String segWit); void deleteIdentity(String password); String exportIdentity(String password); void addWallet(Wallet wallet); List<Wallet> deriveWallets(List<String> chainTypes, String password); String encryptDataToIPFS(String originData); String decryptDataFromIPFS(String encryptedData); String signAuthenticationMessage(int accessTime, String deviceToken, String password); static Identity currentIdentity; static final String TAG; }### Answer:
@Test public void testDeleteIdentity() { Identity identity = Identity.recoverIdentity(SampleKey.MNEMONIC, "xyz", SampleKey.PASSWORD, SampleKey.PASSWORD_HINT, Network.TESTNET, Metadata.NONE); try { identity.exportIdentity(SampleKey.WRONG_PASSWORD); Assert.fail("Should throw exception when delete identity use wrong password"); } catch (TokenException ex) { Assert.assertEquals("Should throw invalid password", Messages.WALLET_INVALID_PASSWORD, ex.getMessage()); } identity.deleteIdentity(SampleKey.PASSWORD); Assert.assertNull("current identity should be null", Identity.getCurrentIdentity()); }