### Question:
Invoker { static Optional<Invoker> makeInvoker(String... args) { return makeInvoker(System.getenv(), args); } Invoker(
      Integer port,
      String functionTarget,
      String functionSignatureType,
      ClassLoader functionClassLoader); static void main(String[] args); void startServer();  }### Answer:
@Test public void help() throws IOException { String help = captureOutput(() -> { Optional<Invoker> invoker = Invoker.makeInvoker("--help"); assertThat(invoker).isEmpty(); }); assertThat(help).contains("Usage:"); assertThat(help).contains("--target"); assertThat(help).containsMatch("separated\\s+by\\s+'" + File.pathSeparator + "'"); }
@Test public void defaultClasspath() { Optional<Invoker> invoker = Invoker.makeInvoker(); assertThat(invoker.get().getClass().getClassLoader()) .isSameInstanceAs(Invoker.class.getClassLoader()); }
@Test public void explicitClasspathViaEnvironment() { Map<String, String> env = Collections.singletonMap("FUNCTION_CLASSPATH", FAKE_CLASSPATH); Optional<Invoker> invoker = Invoker.makeInvoker(env); assertThat(invokerClasspath(invoker.get())).isEqualTo(FAKE_CLASSPATH); }
@Test public void explicitClasspathViaOption() { Optional<Invoker> invoker = Invoker.makeInvoker("--classpath", FAKE_CLASSPATH); assertThat(invokerClasspath(invoker.get())).isEqualTo(FAKE_CLASSPATH); }