class DestinationRuleExample {
  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 destination rule");
    // Example from: https://istio.io/latest/docs/reference/config/networking/destination-rule/
    client.v1beta1().destinationRules().inNamespace(NAMESPACE).create(new DestinationRuleBuilder()
        .withNewMetadata()
        .withName("reviews-route")
        .endMetadata()
        .withNewSpec()
        .withHost("ratings.prod.svc.cluster.local")
        .withNewTrafficPolicy()
        .withLoadBalancer(
            new LoadBalancerSettingsBuilder().withLbPolicy(new LoadBalancerSettingsSimple(LoadBalancerSettingsSimpleLB.RANDOM))
                .build())
        .endTrafficPolicy()
        .endSpec()
        .build());

    System.out.println("Listing destination rules instances:");
    DestinationRuleList list = client.v1beta1().destinationRules().inNamespace(NAMESPACE).list();
    list.getItems().forEach(b -> System.out.println(b.getMetadata().getName()));
    System.out.println("Done");
  
<no_super_class>