### Question:
AccountsManager { public Boolean hasFunds(Accounts accounts, String addressString, BigInteger value) throws IOException, ClassNotFoundException { logger.traceEntry("params: {} {} {}", accounts, addressString, value); Util.check(accounts != null, "accounts!=null"); Util.check(!(addressString == null || addressString.isEmpty()), "addressString!=null"); AccountAddress sendAddress = AccountAddress.fromHexString(addressString); AccountState senderAccountState = AppServiceProvider.getAccountStateService().getOrCreateAccountState(sendAddress, accounts); return logger.traceExit(senderAccountState.getBalance().compareTo(value) >= 0); }  static AccountsManager instance(); Boolean hasFunds(Accounts accounts, String addressString, BigInteger value); Boolean hasCorrectNonce(Accounts accounts, String addressString, BigInteger nonce); void transferFunds(Accounts accounts, String senderAddress, String receiverAddress, BigInteger value, BigInteger nonce, ShardOperation operation);  }### Answer:
@Test public void testHasFundsWithNullAccountsShouldThrowException() throws IOException, ClassNotFoundException { expected(IllegalArgumentException.class, "accounts!=null"); accountsManager.hasFunds(null, "Test", BigInteger.TEN); }
@Test public void testHasFundsWithNullAddressShouldThrowException() throws IOException, ClassNotFoundException { expected(IllegalArgumentException.class, "addressString!=null"); accountsManager.hasFunds(accounts, null, BigInteger.TEN); }
@Test public void testHasFunds() throws IOException, ClassNotFoundException { AccountAddress test = AccountAddress.fromHexString("Test"); AccountState senderAccountState = AppServiceProvider.getAccountStateService().getOrCreateAccountState(test, accounts); senderAccountState.addToBalance(BigInteger.TEN); AppServiceProvider.getAccountStateService().setAccountState(test, senderAccountState, accounts); Assert.assertTrue(accountsManager.hasFunds(accounts, "Test", BigInteger.TEN)); Assert.assertFalse(accountsManager.hasFunds(accounts, "Test", BigInteger.TEN.add(BigInteger.ONE))); }