### Question:
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public boolean validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { return isFreeTx || (state != null && !state.isDeleted()); }  @Override boolean validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx);  }### Answer:
@Test public void validAccountState() { AccountState state = Mockito.mock(AccountState.class); Mockito.when(state.isDeleted()).thenReturn(false); TxValidatorAccountStateValidator tvasv = new TxValidatorAccountStateValidator(); Assert.assertTrue(tvasv.validate(null, state, null, null, Long.MAX_VALUE, false)); }
@Test public void invalidAccountState() { AccountState state = Mockito.mock(AccountState.class); Mockito.when(state.isDeleted()).thenReturn(true); TxValidatorAccountStateValidator tvasv = new TxValidatorAccountStateValidator(); Assert.assertFalse(tvasv.validate(null, state, null, null, Long.MAX_VALUE, false)); }