### Question:
MyTransactionalBean { @Transactional public void withTransaction() { id1 = bean1.getId(); id2 = bean2.getId(); }  @Transactional void withTransaction(); void withoutTransaction();  }### Answer:
@Test public void should_withTransaction_have_only_one_instance_injected() { bean.withTransaction(); assertThat("bean1 and bean2 should the same object", bean.id1, is(bean.id2)); }
@Test public void should_withTransaction_called_twice_have_different_instances_injected() { bean.withTransaction(); String firstId1 = bean.id1; bean.withTransaction(); String secondId1 = bean.id1; assertThat("bean1 should change between scenarios", firstId1, is(not(secondId1))); }