class ExecExample {

  public static void main(String[] args) {
    if (args.length < 1) {
      System.out.println("Usage: podName [namespace]");
      return;
    }

    String podName = args[0];
    String namespace = "default";

    if (args.length > 1) {
      namespace = args[1];
    }

    try (
        KubernetesClient client = new KubernetesClientBuilder().build();
        ExecWatch watch = newExecWatch(client, namespace, podName)) {
      watch.exitCode().join();
    }
  }

  private static ExecWatch newExecWatch(KubernetesClient client, String namespace, String podName) {<FILL_FUNCTION_BODY>}

  private static class SimpleListener implements ExecListener {

    @Override
    public void onOpen() {
      System.out.println("The shell will remain open for 10 seconds.");
    }

    @Override
    public void onFailure(Throwable t, Response failureResponse) {
      System.err.println("shell barfed");
    }

    @Override
    public void onClose(int code, String reason) {
      System.out.println("The shell will now close.");
    }
  }

}

    return client.pods().inNamespace(namespace).withName(podName)
        .writingOutput(System.out)
        .writingError(System.err)
        .withTTY()
        .usingListener(new SimpleListener())
        .exec("sh", "-c", "echo 'Hello world!'");
  
<no_super_class>