docs: public static void doFilter(PortletFilter filter, PortletRequest request, PortletResponse response, FilterChain chain)
              throws IOException, PortletException {
          
          final Object phase = request.getAttribute(PortletRequest.LIFECYCLE_PHASE);
  
          if (PortletRequest.ACTION_PHASE.equals(phase)) {
              if (filter instanceof ActionFilter) {
                  ((ActionFilter) filter).doFilter((ActionRequest) request, (ActionResponse) response, chain);
              }
              else {
                  throw new IllegalArgumentException("Provided filter does not implement ActionFilter as required by : " + phase + " - " + filter); 
              }
          }
          else if (PortletRequest.EVENT_PHASE.equals(phase)) {
              if (filter instanceof EventFilter) {
                  ((EventFilter) filter).doFilter((EventRequest) request, (EventResponse) response, chain);
              }
              else {
                  throw new IllegalArgumentException("Provided filter does not implement EventFilter as required by : " + phase + " - " + filter); 
              }
          }
          else if (PortletRequest.RENDER_PHASE.equals(phase)) {
              if (filter instanceof RenderFilter) {
                  ((RenderFilter) filter).doFilter((RenderRequest) request, (RenderResponse) response, chain);
              }
              else {
                  throw new IllegalArgumentException("Provided filter does not implement RenderFilter as required by : " + phase + " - " + filter); 
              }
          }
          else if (PortletRequest.RESOURCE_PHASE.equals(phase)) {
              if (filter instanceof ResourceFilter) {
                  ((ResourceFilter) filter).doFilter((ResourceRequest) request, (ResourceResponse) response, chain);
              }
              else {
                  throw new IllegalArgumentException("Provided filter does not implement ResourceFilter as required by : " + phase + " - " + filter); 
              }
          }
          else {
              throw new IllegalArgumentException("Unknown Portlet Lifecycle Phase: " + phase);
          }
      }