class KeyChainGroup implements KeyBag {

    public Address freshAddress(KeyChain.KeyPurpose purpose) {
        DeterministicKeyChain chain = getActiveKeyChain();
        if (chain.isMarried()) {
            Script outputScript = chain.freshOutputScript(purpose);
            checkState(ScriptPattern.isPayToScriptHash(outputScript)); // Only handle P2SH for now
            Address freshAddress = LegacyAddress.fromScriptHash(params,
                    ScriptPattern.extractHashFromPayToScriptHash(outputScript));
            maybeLookaheadScripts();
            currentAddresses.put(purpose, freshAddress);
            return freshAddress;
        } else {
            return LegacyAddress.fromKey(params, freshKey(purpose));
        }
    }

    public  KeyChainGroup(NetworkParameters params);
    public  KeyChainGroup(NetworkParameters params, DeterministicSeed seed);
    public  KeyChainGroup(NetworkParameters params, DeterministicSeed seed, ImmutableList<ChildNumber> accountPath);
    public  KeyChainGroup(NetworkParameters params, DeterministicKey watchKey);
    public  KeyChainGroup(NetworkParameters params, DeterministicKey accountKey, boolean watch);
    private  KeyChainGroup(NetworkParameters params, @Nullable BasicKeyChain basicKeyChain, List<DeterministicKeyChain> chains,
                          @Nullable EnumMap<KeyChain.KeyPurpose, DeterministicKey> currentKeys, @Nullable KeyCrypter crypter);

}