code: protected <T extends HistoryEvent> T findInCache(Class<T> type, String id) {
      return Context.getCommandContext()
        .getDbEntityManager()
        .getCachedEntity(type, id);
    }
docs: find a cached entity by primary key