@Test
 public void currentP2SHAddress() throws Exception {
   group = createMarriedKeyChainGroup();
   Address a1 = group.currentAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
   assertTrue(a1.isP2SHAddress());
   Address a2 = group.currentAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
   assertEquals(a1, a2);
   Address a3 = group.currentAddress(KeyChain.KeyPurpose.CHANGE);
   assertNotEquals(a2, a3);
 }
  @Test
  public void freshAddress() throws Exception {
    group = createMarriedKeyChainGroup();
    Address a1 = group.freshAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
    Address a2 = group.freshAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
    assertTrue(a1.isP2SHAddress());
    assertNotEquals(a1, a2);
    group.getBloomFilterElementCount();
    assertEquals(
        ((group.getLookaheadSize() + group.getLookaheadThreshold())
                * 2) // * 2 because of internal/external
            + (2 - group.getLookaheadThreshold()) // keys issued
            + 4 /* master, account, int, ext */,
        group.numKeys());

    Address a3 = group.currentAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
    assertEquals(a2, a3);
  }