class PodExecEquivalent {
  private static final Logger logger = LoggerFactory.getLogger(PodExecEquivalent.class);
  private static final CountDownLatch execLatch = new CountDownLatch(1);

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

  private static class MyPodExecListener implements ExecListener {
    @Override
    public void onOpen() {
      logger.info("Shell was opened");
    }

    @Override
    public void onFailure(Throwable t, Response failureResponse) {
      logger.info("Some error encountered");
      execLatch.countDown();
    }

    @Override
    public void onClose(int i, String s) {
      logger.info("Shell Closing");
      execLatch.countDown();
    }
  }
}

    try (final KubernetesClient k8s = new KubernetesClientBuilder().build()) {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      ByteArrayOutputStream error = new ByteArrayOutputStream();

      ExecWatch execWatch = k8s.pods().inNamespace("default").withName("my-pod")
          .writingOutput(out)
          .writingError(error)
          .usingListener(new MyPodExecListener())
          .exec("ls", "/");

      boolean latchTerminationStatus = execLatch.await(5, TimeUnit.SECONDS);
      if (!latchTerminationStatus) {
        logger.warn("Latch could not terminate within specified time");
      }
      logger.info("Exec Output: {} ", out);
      execWatch.close();
    } catch (InterruptedException ie) {
      Thread.currentThread().interrupt();
      logger.warn("Interrupted while waiting for the exec: {}", ie.getMessage());
    }
  
<no_super_class>