Accounts implements Serializable, PersistenceUnitContainer { public AccountsPersistenceUnit<AccountAddress, AccountState> getAccountsPersistenceUnit() { return unit; } Accounts(AccountsContext context, AccountsPersistenceUnit<AccountAddress, AccountState> unit); Shard getShard(); AccountsPersistenceUnit<AccountAddress, AccountState> getAccountsPersistenceUnit(); Set<AccountAddress> getAddresses(); void flush(); @Override void stopPersistenceUnit();  }
@Test public void testGetAccountsPersistenceUnit() throws IOException { AccountsPersistenceUnit<AccountAddress, AccountState> unit = new AccountsPersistenceUnit<>(""); AccountsContext accountsContext = new AccountsContext(); PublicKey publicKeyMinting = AppServiceProvider.getShardingService().getPublicKeyForMinting(new Shard(0)); accountsContext.setShard(AppServiceProvider.getShardingService().getShard(publicKeyMinting.getValue())); Accounts accounts = new Accounts(accountsContext, unit); Assert.assertEquals(unit, accounts.getAccountsPersistenceUnit()); }