### Question:
TransactionInfo implements Serializable { public boolean rollbackOn(Throwable ex) { RollbackRule winner = null; int deepest = Integer.MAX_VALUE; if (CollectionUtils.isNotEmpty(rollbackRules)) { winner = NoRollbackRule.DEFAULT_NO_ROLLBACK_RULE; for (RollbackRule rule : this.rollbackRules) { int depth = rule.getDepth(ex); if (depth >= 0 && depth < deepest) { deepest = depth; winner = rule; } } } return !(winner instanceof NoRollbackRule); }  int getTimeOut(); void setTimeOut(int timeOut); String getName(); void setName(String name); Set<RollbackRule> getRollbackRules(); void setRollbackRules(Set<RollbackRule> rollbackRules); boolean rollbackOn(Throwable ex); Propagation getPropagation(); void setPropagation(Propagation propagation);  }### Answer:
@Test public void testRollBackOn() { TransactionInfo txInfo = new TransactionInfo(); assertThat(txInfo.rollbackOn(new IllegalArgumentException())).isTrue(); assertThat(txInfo.rollbackOn(new Exception())).isTrue(); assertThat(txInfo.rollbackOn(new IOException())).isTrue(); assertThat(txInfo.rollbackOn(new NullPointerException())).isTrue(); Set<RollbackRule> sets = getRollbackRules(); txInfo.setRollbackRules(sets); assertThat(txInfo.rollbackOn(new IllegalArgumentException())).isTrue(); assertThat(txInfo.rollbackOn(new IllegalStateException())).isTrue(); assertThat(txInfo.rollbackOn(new IOException())).isFalse(); assertThat(txInfo.rollbackOn(new NullPointerException())).isFalse(); assertThat(txInfo.rollbackOn(new MyRuntimeException("test"))).isFalse(); assertThat(txInfo.rollbackOn(new RuntimeException())).isFalse(); assertThat(txInfo.rollbackOn(new Throwable())).isFalse(); }