code: @SuppressWarnings("unchecked")
      public static PaxWicketApplicationFactory
          createPaxWicketApplicationFactory(
                  BundleContext bundleContext,
                  WebApplicationFactory<?> webApplicationFactory,
                  ServiceReference<WebApplicationFactory<?>> reference) {
          File tmpDir = retrieveTmpFile(bundleContext);
          tmpDir.mkdirs();
          String mountPoint = (String) reference.getProperty(Constants.MOUNTPOINT);
          String applicationName = (String) reference.getProperty(Constants.APPLICATION_NAME);
          Map<String, String> contextParams = (Map<String, String>) reference.getProperty(Constants.CONTEXT_PARAMS);
  
          if (contextParams == null) {
              contextParams = new HashMap<String, String>();
          }
          if (!contextParams.containsKey(WicketFilter.FILTER_MAPPING_PARAM)) {
              contextParams.put(WicketFilter.FILTER_MAPPING_PARAM, "/" + mountPoint + "/*");
          }
  
          FilterDelegator filterDelegator =
                  new FilterDelegator(reference.getBundle().getBundleContext(), applicationName);
          PaxWicketApplicationFactory factory =
              new PaxWicketApplicationFactory(bundleContext, webApplicationFactory, applicationName, mountPoint,
                  contextParams, tmpDir, filterDelegator);
          return factory;
      }
docs: <p>createPaxWicketApplicationFactory.</p>
  
  @param bundleContext a {@link org.osgi.framework.BundleContext} object.
  @param webApplicationFactory a {@link org.ops4j.pax.wicket.api.WebApplicationFactory} object.
  @param reference a {@link org.osgi.framework.ServiceReference} object.
  @return a {@link org.ops4j.pax.wicket.internal.PaxWicketApplicationFactory} object.