code: public RemoteFramework fork(List<String> vmArgs, Map<String, String> systemProperties,
          Map<String, Object> frameworkProperties, List<String> beforeFrameworkClasspath,
          List<String> afterFrameworkClasspath) {
          // TODO make port range configurable
          FreePort freePort = new FreePort(21000, 21099);
          port = freePort.getPort();
          LOG.debug("using RMI registry at port {}", port);
  
          String rmiName = "ExamRemoteFramework-" + UUID.randomUUID().toString();
  
          try {
              String address = InetAddress.getLoopbackAddress().getHostAddress();
              System.setProperty("java.rmi.server.hostname", address);
              registry = LocateRegistry.createRegistry(port);
  
              Map<String, String> systemPropsNew = new HashMap<>(systemProperties);
              systemPropsNew.put("java.rmi.server.hostname", address);
              systemPropsNew.put(RemoteFramework.RMI_PORT_KEY, Integer.toString(port));
              systemPropsNew.put(RemoteFramework.RMI_NAME_KEY, rmiName);
              String[] vmOptions = buildSystemProperties(vmArgs, systemPropsNew);
              String[] args = buildFrameworkProperties(frameworkProperties);
              javaRunner = new DefaultJavaRunner(false);
              javaRunner.exec(vmOptions, buildClasspath(beforeFrameworkClasspath, afterFrameworkClasspath),
                  RemoteFrameworkImpl.class.getName(), args, getJavaHome(), null);
              return findRemoteFramework(address, port, rmiName);
          }
          catch (RemoteException | ExecutionException | URISyntaxException exc) {
              throw new TestContainerException(exc);
          }
      }
docs: Forks a Java VM process running an OSGi framework and returns a {@link RemoteFramework}
  handle to it.
  <p>
  
  @param vmArgs
  VM arguments
  @param systemProperties
  system properties for the forked Java VM
  @param frameworkProperties
  framework properties for the remote framework
  @param beforeFrameworkClasspath
  system classpath entries before the framework itself
  @param afterFrameworkClasspath
  system classpath entries after the framework itself
  @return remote framework