code: public synchronized List<WorkManagerEvent> getEvents(String workManagerName)
     {
        List<WorkManagerEvent> result = new ArrayList<WorkManagerEvent>();
        List<WorkManagerEvent> e = events.get(workManagerName);
  
        if (e != null)
        {
           result.addAll(e);
           e.clear();
        }
  
        if (trace)
           log.tracef("getEvents(%s): %s", workManagerName, result);
  
        return result;
     }
docs: Get events
  @param workManagerName The name of the WorkManager
  @return The list of events