### Question:
BaseEntity { @PreUpdate public void preUpdate() { this.modificationTime = DateTime.now(); }  abstract ID getId(); DateTime getCreationTime(); DateTime getModificationTime(); long getVersion(); @PrePersist void prePersist(); @PreUpdate void preUpdate();  }### Answer:
@Test public void preUpdated_ShouldUpdateModificationTime() { DateTime yesterday = DateTime.now().minusDays(1); TestEntity entity = new TestEntityBuilder() .creationTime(yesterday) .modificationTime(yesterday) .build(); entity.preUpdate(); assertThat(entity) .creationTimeIsSet() .modificationTimeIsSet() .modificationTimeIsAfterCreationTime(); }