@Test
public void canBeCommittedIfSubclassOfIgnoredExceptionThrown() {

  Transactional transactional = createNiceMock(Transactional.class);
  EntityTransaction transaction = createStrictMock(EntityTransaction.class);
  expect(transaction.getRollbackOnly()).andReturn(false);
  expect(transactional.rollbackOn()).andReturn(asArray(Exception.class));
  expect(transactional.ignore()).andReturn(asArray(IOException.class));
  replayAll();
  boolean canCommit = rollbackIfNecessary(transactional, new FileNotFoundException("rolling back"), transaction);
  Assert.assertTrue("Should be allowed to commit, since subclass of ignored exception was thrown", canCommit);
  verifyAll();
}