public List<Address> getWatchedAddresses() {
        keyChainGroupLock.lock();
        try {
            List<Address> addresses = new LinkedList<>();
            for (Script script : watchedScripts)
                if (ScriptPattern.isP2PKH(script))
                    addresses.add(script.getToAddress(network));
            return addresses;
        } finally {
            keyChainGroupLock.unlock();
        }
    }
@Test
    public void getWatchedAddresses() {
        Address watchedAddress = new ECKey().toAddress(ScriptType.P2PKH, TESTNET);
        wallet.addWatchedAddress(watchedAddress);
        List<Address> watchedAddresses = wallet.getWatchedAddresses();
        assertEquals(1, watchedAddresses.size());
        assertEquals(watchedAddress, watchedAddresses.get(0));
    }