docs: static ModifiableRealmIdentity getRealmIdentity(OperationContext context, String principalName) throws OperationFailedException {
          ModifiableSecurityRealm modifiableRealm = getModifiableSecurityRealm(context);
          ModifiableRealmIdentity realmIdentity = null;
          try {
              realmIdentity = modifiableRealm.getRealmIdentityForUpdate(new NamePrincipal(principalName));
  
              if (!realmIdentity.exists()) {
                  throw new OperationFailedException(ROOT_LOGGER.identityNotFound(principalName));
              }
  
              return realmIdentity;
          } catch (RealmUnavailableException e) {
              throw ROOT_LOGGER.couldNotReadIdentity(principalName, e);
          } finally {
              if (realmIdentity != null) {
                  realmIdentity.dispose();
              }
          }
      }