class WaitUntilReadyExample {

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

  @SuppressWarnings("java:S106")
  public static void main(String[] args) throws InterruptedException {<FILL_FUNCTION_BODY>}
}

    try (KubernetesClient client = new KubernetesClientBuilder().build()) {
      final String namespace = Optional.ofNullable(client.getNamespace()).orElse("default");
      final Pod pod = client.pods().inNamespace(namespace).resource(
          new PodBuilder()
              .withNewMetadata().withName("myapp-pod").withLabels(Collections.singletonMap("app", "myapp-pod")).endMetadata()
              .withNewSpec()
              .addNewContainer()
              .withName("myapp-container")
              .withImage("busybox:1.28")
              .withCommand("sh", "-c", "echo 'The app is running!'; sleep 10")
              .endContainer()
              .addNewInitContainer()
              .withName("init-myservice")
              .withImage("busybox:1.28")
              .withCommand("sh", "-c", "echo 'initializing...'; sleep 5")
              .endInitContainer()
              .endSpec()
              .build())
          .create();
      logger.info("Pod created, waiting for it to get ready...");
      client.resource(pod).inNamespace(namespace).waitUntilReady(10, TimeUnit.SECONDS);
      logger.info("Pod is ready now");
      final LogWatch lw = client.pods().inNamespace(namespace).withName(pod.getMetadata().getName()).watchLog(System.out);
      logger.info("Watching Pod logs for 10 seconds...");
      TimeUnit.SECONDS.sleep(10L);
      logger.info("Deleting Pod...");
      client.resource(pod).inNamespace(namespace).delete();
      logger.info("Closing Pod log watch");
      lw.close();
    }
  
<no_super_class>