*/
@SuppressWarnings("unchecked")
public Revision<N, T> findLastChangeRevision(ID id) {
Class<T> type = entityInformation.getJavaType();
AuditReader reader = AuditReaderFactory.get(entityManager);
List<Number> revisions = reader.getRevisions(type, id);
if (revisions.isEmpty()) {
return null;
}
N latestRevision = (N) revisions.get(revisions.size() - 1);
Class<?> revisionEntityClass = revisionEntityInformation.getRevisionEntityClass();
Object revisionEntity = reader.findRevision(revisionEntityClass, latestRevision);
RevisionMetadata<N> metadata = (RevisionMetadata<N>) getRevisionMetadata(revisionEntity);
return new Revision<N, T>(metadata, reader.find(type, id, latestRevision));
}