code: public void exec(final FtRemote.Script script) throws IOException {
          final AtomicBoolean exit = new AtomicBoolean();
          final CountDownLatch latch = new CountDownLatch(1);
          final Thread thread = new Thread(
              new Runnable() {
                  @Override
                  public void run() {
                      try {
                          FtRemote.this.start(
                              new Exit() {
                                  @Override
                                  public boolean ready() {
                                      latch.countDown();
                                      return exit.get();
                                  }
                              }
                          );
                      } catch (final IOException ex) {
                          throw new IllegalStateException(ex);
                      }
                  }
              }
          );
          thread.start();
          try {
              // @checkstyle MagicNumber (1 line)
              if (!latch.await(10L, TimeUnit.SECONDS)) {
                  throw new IllegalArgumentException(
                      "failed to start the app"
                  );
              }
          } catch (final InterruptedException ex) {
              Thread.currentThread().interrupt();
              throw new IllegalStateException(ex);
          }
          final String protocol;
          if (this.secured) {
              protocol = "https";
          } else {
              protocol = "http";
          }
          script.exec(
              URI.create(
                  String.format(
                      "%s://localhost:%d",
                      protocol, this.socket.getLocalPort()
                  )
              )
          );
          exit.set(true);
          try {
              thread.join();
          } catch (final InterruptedException ex) {
              Thread.currentThread().interrupt();
              throw new IllegalStateException(ex);
          }
      }
docs: Execute this script against a running front.
  @param script Script to run
  @throws IOException If fails