identify author of an entity
Afaik, there's no requirement that a Content Entity must store the id of the user who created/edited it. However, many entity types do use a common method to store the owner information - Drupal core's user module provides an EntityOwnerTrait that many entity types use. (At least Node, Media, etc, all use this trait.)
For example, if you're looking for the owner of an entity that uses this trait, you can use the getOwner() method like:
$owner_user_object = $entity-&gt;getOwner();


It's unclear if user U2, in your example, would be the owner of the entity or just the author of a particular revision. If your entity is storing revision information, and the entity extends EditorialContentEntityBase (Note that they probably do. Node, Media, etc, all extend this base class) then it's also possible to load the author of a particular revision.
First, load the revision. See @baikho's comment pointing to Preferred way of loading a specific entity revision.
$entity_revision = \Drupal::entityTypeManager()
  -&gt;getStorage('MY_ENTITY_EYPE')
  -&gt;loadRevision($MY_REVISION_ID);

Once you'd loaded the revision, you can get the author of that revision with the getRevisionUser() method like:
$revision_user_object = $entity_revision-&gt;getRevisionUser()