WalletPocketHD extends BitWalletBase { public Set<AbstractAddress> getUsedAddresses() { lock.lock(); try { HashSet<AbstractAddress> usedAddresses = new HashSet<>(); for (Map.Entry<AbstractAddress, String> entry : addressesStatus.entrySet()) { if (entry.getValue() != null) { usedAddresses.add(entry.getKey()); } } return usedAddresses; } finally { lock.unlock(); } } WalletPocketHD(DeterministicKey rootKey, CoinType coinType,
                          @Nullable KeyCrypter keyCrypter, @Nullable KeyParameter key);   WalletPocketHD(SimpleHDKeyChain keys, CoinType coinType);   WalletPocketHD(String id, SimpleHDKeyChain keys, CoinType coinType); int getAccountIndex(); @Override boolean isEncryptable(); @Override boolean isEncrypted(); @Nullable @Override KeyCrypter getKeyCrypter(); @Override void encrypt(KeyCrypter keyCrypter, KeyParameter aesKey); @Override void decrypt(KeyParameter aesKey); @Override String getPublicKeySerialized(); @Override boolean isWatchedScript(Script script); @Override boolean isPayToScriptHashMine(byte[] payToScriptHash); @Nullable @Override ECKey findKeyFromPubHash(byte[] pubkeyHash); @Nullable @Override ECKey findKeyFromPubKey(byte[] pubkey); @Nullable @Override RedeemData findRedeemDataFromScriptHash(byte[] bytes); @Override byte[] getPublicKey(); @Override BitAddress getChangeAddress(); @Override BitAddress getReceiveAddress(); BitAddress getRefundAddress(); @Override boolean hasUsedAddresses(); @Override boolean canCreateNewAddresses(); @Override BitAddress getReceiveAddress(boolean isManualAddressManagement); @Override BitAddress getRefundAddress(boolean isManualAddressManagement); @Nullable BitAddress getLastUsedAddress(SimpleHDKeyChain.KeyPurpose purpose); boolean canCreateFreshReceiveAddress(); BitAddress getFreshReceiveAddress(); BitAddress getFreshReceiveAddress(boolean isManualAddressManagement); int getNumberIssuedReceiveAddresses(); List<AbstractAddress> getIssuedReceiveAddresses(); Set<AbstractAddress> getUsedAddresses(); BitAddress getAddress(SimpleHDKeyChain.KeyPurpose purpose,
                              boolean isManualAddressManagement); @VisibleForTesting void maybeInitializeAllKeys(); @Override String getPublicKeyMnemonic(); @Override List<AbstractAddress> getActiveAddresses(); @Override void markAddressAsUsed(AbstractAddress address); void markAddressAsUsed(BitAddress address); @Override String toString();  }
@Test public void usedAddresses() throws Exception { assertEquals(0, pocket.getUsedAddresses().size()); pocket.onConnection(getBlockchainConnection(DOGE)); assertEquals(13, pocket.getUsedAddresses().size()); }