class GatewayExample {
  private static final String NAMESPACE = "test";

  public static void main(String[] args) {
    try {
      IstioClient client = ClientFactory.newClient(args);
      createResource(client);
      System.exit(0);
    } catch (KubernetesClientException ex) {
      System.err.println("Failed with " + ex.getMessage());
      System.exit(1);
    }
  }

  public static void createResource(IstioClient client) {<FILL_FUNCTION_BODY>}
}

    System.out.println("Creating a gateway");
    // Example from: https://istio.io/latest/docs/reference/config/networking/gateway/
    client.v1beta1().gateways().inNamespace(NAMESPACE).create(new GatewayBuilder()
        .withNewMetadata()
        .withName("my-gateway")
        .endMetadata()
        .withNewSpec()
        .withSelector(Collections.singletonMap("app", "my-gateway-controller"))
        .withServers(new ServerBuilder()
            .withPort(new PortBuilder().withNumber(80).withProtocol("HTTP").withName("http").build())
            .withHosts("uk.bookinfo.com", "eu.bookinfo.com")
            .withTls(new ServerTLSSettingsBuilder().withHttpsRedirect(true).build())
            .build())
        .endSpec()
        .build());

    System.out.println("Listing gateway instances:");
    GatewayList list = client.v1beta1().gateways().inNamespace(NAMESPACE).list();
    list.getItems().forEach(b -> System.out.println(b.getMetadata().getName()));
    System.out.println("Done");
  
<no_super_class>