code: private Events _getEvents(PhaseId phaseId)
      {
          // Gather the events and purge the event list to prevent concurrent modification during broadcasting
          int size = _events.size();
          List<FacesEvent> anyPhase = new ArrayList<FacesEvent>(size);
          List<FacesEvent> onPhase = new ArrayList<FacesEvent>(size);
          
          for (int i = 0; i < size; i++)
          {
              FacesEvent event = _events.get(i);
              if (event.getPhaseId().equals(PhaseId.ANY_PHASE))
              {
                  anyPhase.add(event);
                  _events.remove(i);
                  size--;
                  i--;
              }
              else if (event.getPhaseId().equals(phaseId))
              {
                  onPhase.add(event);
                  _events.remove(i);
                  size--;
                  i--;
              }
          }
          
          return new Events(anyPhase, onPhase);
      }
docs: Gathers all event for current and ANY phase
  @param phaseId current phase id