### Question:
DeterministicKeyChain implements EncryptableKeyChain { @Override public DeterministicKeyChain toDecrypted(CharSequence password) { checkNotNull(password); checkArgument(password.length() > 0); KeyCrypter crypter = getKeyCrypter(); checkState(crypter != null, "Chain not encrypted"); KeyParameter derivedKey = crypter.deriveKey(password); return toDecrypted(derivedKey); } DeterministicKeyChain(SecureRandom random);  DeterministicKeyChain(SecureRandom random, int bits);  DeterministicKeyChain(SecureRandom random, int bits, String passphrase, long seedCreationTimeSecs);  DeterministicKeyChain(byte[] entropy, String passphrase, long seedCreationTimeSecs); protected  DeterministicKeyChain(DeterministicSeed seed);  DeterministicKeyChain(DeterministicKey watchingKey, long creationTimeSeconds);  DeterministicKeyChain(DeterministicKey watchingKey); private  DeterministicKeyChain(DeterministicKey watchKey, boolean isFollowing);   DeterministicKeyChain(DeterministicSeed seed, @Nullable KeyCrypter crypter); private  DeterministicKeyChain(KeyCrypter crypter, KeyParameter aesKey, DeterministicKeyChain chain); static DeterministicKeyChain watchAndFollow(DeterministicKey watchKey); static DeterministicKeyChain watch(DeterministicKey accountKey); static DeterministicKeyChain watch(DeterministicKey accountKey, long seedCreationTimeSecs); @Override DeterministicKey getKey(KeyPurpose purpose); @Override List<DeterministicKey> getKeys(KeyPurpose purpose, int numberOfKeys); DeterministicKey markKeyAsUsed(DeterministicKey k); DeterministicKey findKeyFromPubHash(byte[] pubkeyHash); DeterministicKey findKeyFromPubKey(byte[] pubkey); @Nullable DeterministicKey markPubHashAsUsed(byte[] pubkeyHash); @Nullable DeterministicKey markPubKeyAsUsed(byte[] pubkey); @Override boolean hasKey(ECKey key); DeterministicKey getKeyByPath(List<ChildNumber> path, boolean create); DeterministicKey getWatchingKey(); @Override int numKeys(); int numLeafKeysIssued(); @Override long getEarliestKeyCreationTime(); @Override void addEventListener(KeyChainEventListener listener); @Override void addEventListener(KeyChainEventListener listener, Executor executor); @Override boolean removeEventListener(KeyChainEventListener listener); @Nullable List<String> getMnemonicCode(); boolean isFollowing(); @Override List<Protos.Key> serializeToProtobuf(); static List<DeterministicKeyChain> fromProtobuf(List<Protos.Key> keys, @Nullable KeyCrypter crypter); @Override DeterministicKeyChain toEncrypted(CharSequence password); @Override DeterministicKeyChain toEncrypted(KeyCrypter keyCrypter, KeyParameter aesKey); @Override DeterministicKeyChain toDecrypted(CharSequence password); @Override DeterministicKeyChain toDecrypted(KeyParameter aesKey); @Override boolean checkPassword(CharSequence password); @Override boolean checkAESKey(KeyParameter aesKey); @Nullable @Override KeyCrypter getKeyCrypter(); @Override int numBloomFilterEntries(); @Override BloomFilter getFilter(int size, double falsePositiveRate, long tweak); int getLookaheadSize(); void setLookaheadSize(int lookaheadSize); void setLookaheadThreshold(int num); int getLookaheadThreshold(); void maybeLookAhead(); int getIssuedExternalKeys(); int getIssuedInternalKeys(); @Nullable DeterministicSeed getSeed(); List<DeterministicKey> getLeafKeys(); int getKeyLookaheadEpoch(); static final String DEFAULT_PASSPHRASE_FOR_MNEMONIC; static final ImmutableList<ChildNumber> ACCOUNT_ZERO_PATH; static final ImmutableList<ChildNumber> EXTERNAL_PATH; static final ImmutableList<ChildNumber> INTERNAL_PATH; }### Answer:
@Test(expected = IllegalStateException.class) public void notEncrypted() { chain.toDecrypted("fail"); }