### Question:
Wallet { public boolean lockAccount(UscAddress addr) { synchronized (accessLock) { if (!accounts.containsKey(addr)) { return false; } accounts.remove(addr); return true; } } Wallet(KeyValueDataSource keyDS); List<byte[]> getAccountAddresses(); String[] getAccountAddressesAsHex(); UscAddress addAccount(); UscAddress addAccount(String passphrase); UscAddress addAccount(Account account); Account getAccount(UscAddress addr); Account getAccount(UscAddress addr, String passphrase); boolean unlockAccount(UscAddress addr, String passphrase, long duration); boolean unlockAccount(UscAddress addr, String passphrase); boolean lockAccount(UscAddress addr); byte[] addAccountWithSeed(String seed); byte[] addAccountWithPrivateKey(byte[] privateKeyBytes); byte[] addAccountWithPrivateKey(byte[] privateKeyBytes, String passphrase);  }### Answer:
@Test public void lockAccount() { Wallet wallet = WalletFactory.createWallet(); byte[] address = wallet.addAccount("passphrase").getBytes(); Assert.assertNotNull(address); Assert.assertTrue(wallet.unlockAccount(new UscAddress(address), "passphrase")); Account account = wallet.getAccount(new UscAddress(address)); Assert.assertNotNull(account); Assert.assertArrayEquals(address, account.getAddress().getBytes()); Assert.assertTrue(wallet.lockAccount(new UscAddress(address))); Account account2 = wallet.getAccount(new UscAddress(address)); Assert.assertNull(account2); }
@Test public void lockNonexistentAccount() { Wallet wallet = WalletFactory.createWallet(); UscAddress addr = new UscAddress("0x0000000000000000000000000000000000000023"); Assert.assertFalse(wallet.lockAccount(addr)); }