class SimpleHDKeyChain implements EncryptableKeyChain, KeyBag {

    @Nullable
    public DeterministicKey getLastIssuedKey(KeyPurpose purpose) {
        lock.lock();
        try {
            List<DeterministicKey> keys;
            switch (purpose) {
                case RECEIVE_FUNDS:
                case REFUND:
                    if (issuedExternalKeys <= 0) return null;
                    keys = getDeterministicKeys(1, externalKey, issuedExternalKeys);
                    break;
                case CHANGE:
                    if (issuedInternalKeys <= 0) return null;
                    keys = getDeterministicKeys(1, internalKey, issuedInternalKeys);
                    break;
                default:
                    throw new UnsupportedOperationException();
            }

            return keys.get(0);
        } finally {
            lock.unlock();
        }
    }

    public  SimpleHDKeyChain(DeterministicKey rootkey);
      SimpleHDKeyChain(DeterministicKey rootkey, @Nullable KeyCrypter crypter);
      SimpleHDKeyChain(DeterministicKey rootkey, @Nullable KeyCrypter crypter,
                     @Nullable KeyParameter key);
    private  SimpleHDKeyChain(KeyCrypter crypter, KeyParameter aesKey, SimpleHDKeyChain chain);

}