public void favoursVersionAnnotationIfPresent() {
EntityInformation<VersionedUser, Long> information = new JpaMetamodelEntityInformation<VersionedUser, Long>(
VersionedUser.class, em.getMetamodel());
VersionedUser entity = new VersionedUser();
assertThat(information.isNew(entity), is(true));
entity.setId(1L);
assertThat(information.isNew(entity), is(true));
entity.setVersion(1L);
assertThat(information.isNew(entity), is(false));
entity.setId(null);
assertThat(information.isNew(entity), is(false));
}