class PortForwardExample {

  private static final Logger logger = LoggerFactory.getLogger(PortForwardExample.class);

  public static void main(String[] args) {<FILL_FUNCTION_BODY>}
}

    final ConfigBuilder configBuilder = new ConfigBuilder();
    if (args.length > 0) {
      configBuilder.withMasterUrl(args[0]);
      logger.info("Using master with URL: {}", args[0]);
    }
    try (KubernetesClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build()) {
      String namespace = "default";
      logger.info("Using namespace: {}", namespace);
      Pod pod = client.pods().inNamespace(namespace)
          .load(PortForwardExample.class.getResourceAsStream("/portforward-example-pod.yml")).item();
      final String podName = pod.getMetadata().getName();
      client.pods().inNamespace(namespace).resource(pod).create();
      logger.info("Pod {} created", podName);

      int containerPort = pod.getSpec().getContainers().get(0).getPorts().get(0).getContainerPort();
      client.pods().inNamespace(namespace).withName(podName).waitUntilReady(10, TimeUnit.SECONDS);

      InetAddress inetAddress = InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 });
      LocalPortForward portForward = client.pods().inNamespace("default").withName("testpod").portForward(containerPort,
          inetAddress, 8080);
      logger.info("Port forwarded for 60 seconds at http://127.0.0.1:{}", portForward.getLocalPort());

      logger.info("Checking forwarded port:-");
      final ResponseBody responseBody = new OkHttpClient()
          .newCall(new Request.Builder().get().url("http://127.0.0.1:" + portForward.getLocalPort()).build()).execute()
          .body();
      logger.info("Response: \n{}", responseBody != null ? responseBody.string() : "[Empty Body]");
      Thread.sleep(60 * 1000L);
      logger.info("Closing forwarded port");
      portForward.close();
    } catch (Exception e) {
      logger.error("Exception occurred: {}", e.getMessage(), e);
    }
  
<no_super_class>