@Test
public void testBalanceAfterAdd() {

  // Configure supporting objects
  Account<DefaultEntry> account1 = new Account<DefaultEntry>();
  Account<DefaultEntry> account2 = new Account<DefaultEntry>();
  DateTime then = new DateTime(2000, 1, 2, 12, 34, 56, 0);
  // Create a deposit and withdrawal pair
  DefaultEntry w1 = new DefaultEntry(account1, -10, then, then);
  DefaultEntry d1 = new DefaultEntry(account2, 10, then, then);
  Transaction<DefaultEntry> tx = new Transaction<DefaultEntry>(w1, d1);
  tx.commit();
  assertThat(account1.getBalance(), equalTo(-10L));
  assertThat(account2.getBalance(), equalTo(10L));
}