class ServiceExample {

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

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

    try (KubernetesClient client = new KubernetesClientBuilder().build()) {
      String namespace = Optional.ofNullable(client.getNamespace()).orElse("default");
      if (args.length > 0) {
        namespace = args[0];
      }
      Service service = new ServiceBuilder()
          .withNewMetadata()
          .withName("my-service")
          .endMetadata()
          .withNewSpec()
          .withSelector(Collections.singletonMap("app", "MyApp"))
          .addNewPort()
          .withName("test-port")
          .withProtocol("TCP")
          .withPort(80)
          .withTargetPort(new IntOrString(9376))
          .endPort()
          .withType("LoadBalancer")
          .endSpec()
          .build();

      service = client.services().inNamespace(namespace).resource(service).create();
      logger.info("Created service with name {}", service.getMetadata().getName());

      String serviceURL = client.services().inNamespace(namespace).withName(service.getMetadata().getName())
          .getURL("test-port");
      logger.info("Service URL {}", serviceURL);
    }
  
<no_super_class>