AccountStateServiceImpl implements AccountStateService { @Override public synchronized AccountState getAccountState(AccountAddress address, Accounts accounts) { logger.traceEntry("params: {} {}", address, accounts); if (address == null) { logger.trace("address is null"); return logger.traceExit((AccountState) null); } PersistenceUnit<AccountAddress, AccountState> unit = accounts.getAccountsPersistenceUnit(); byte[] bytes = address.getBytes(); byte[] data = unit.get(bytes); return logger.traceExit((data != null) ? convertToAccountStateFromRLP(data) : null); }  @Override synchronized AccountState getOrCreateAccountState(AccountAddress address, Accounts accounts); @Override synchronized AccountState getAccountState(AccountAddress address, Accounts accounts); @Override synchronized void rollbackAccountStates(Accounts accounts); @Override synchronized void commitAccountStates(Accounts accounts); @Override synchronized void setAccountState(AccountAddress address, AccountState state, Accounts accounts); @Override byte[] convertAccountStateToRLP(AccountState accountState); @Override AccountState convertToAccountStateFromRLP(byte[] data); @Override void initialMintingToKnownAddress(Accounts accounts); @Override Fun.Tuple2<Block, Transaction> generateGenesisBlock(String initialAddress, BigInteger initialValue, AppState state, AppContext context);  }
@Test public void testGetAccountStateWithNonExistingAddress() throws IOException, ClassNotFoundException { AccountState state = accountStateService.getAccountState(address, accounts); Assert.assertNull(state); }