@Override
  public Object resolveParameter(ParameterContext parameterContext, ExtensionContext context)
      throws ParameterResolutionException {
    List<DoNothingTCPServer> servers = (List<DoNothingTCPServer>) context.getStore(ExtensionContext.Namespace.GLOBAL)
        .getOrComputeIfAbsent(context.getUniqueId(), (id) -> new ArrayList<DoNothingTCPServer>());
    try {
      DoNothingTCPServer server = new DoNothingTCPServer();
      server.start();
      servers.add(server);
      return server;
    } catch (IOException e) {
      throw new ParameterResolutionException("Problem when initialising the server; see cause for details.", e);
    }
  }
A JUnit Jupiter extension for creating and destroying TCP servers.

@see DoNothingTCPServer
testutils/src/java/org/apache/hive/testutils/junit/extensions/DoNothingTCPServerExtension.java