@Test
public void getLastIssuedKey() {

    assertNull(chain.getLastIssuedKey(KeyChain.KeyPurpose.RECEIVE_FUNDS));
    assertNull(chain.getLastIssuedKey(KeyChain.KeyPurpose.CHANGE));
    DeterministicKey extKey = chain.getKey(KeyChain.KeyPurpose.RECEIVE_FUNDS);
    DeterministicKey intKey = chain.getKey(KeyChain.KeyPurpose.CHANGE);
    assertEquals(extKey, chain.getLastIssuedKey(KeyChain.KeyPurpose.RECEIVE_FUNDS));
    assertEquals(intKey, chain.getLastIssuedKey(KeyChain.KeyPurpose.CHANGE));
}