class URLFromIngressImpl implements ServiceToURLProvider {

  @Override
  public String getURL(Service service, String portName, String namespace, KubernetesClient client) {<FILL_FUNCTION_BODY>}

  @Override
  public int getPriority() {
    return ServiceToUrlImplPriority.FIRST.getValue();
  }

}

    ServicePort port = URLFromServiceUtil.getServicePortByName(service, portName);
    String serviceName = service.getMetadata().getName();
    if (port == null) {
      throw new RuntimeException("Couldn't find port: " + portName + " for service " + service.getMetadata().getName());
    }

    if (client.supports(io.fabric8.kubernetes.api.model.extensions.Ingress.class)) {
      io.fabric8.kubernetes.api.model.extensions.IngressList ingresses = client.extensions().ingresses().inNamespace(namespace)
          .list();
      if (ingresses != null && !ingresses.getItems().isEmpty()) {
        return URLFromServiceUtil.getURLFromExtensionsV1beta1IngressList(ingresses.getItems(), namespace, serviceName, port);
      }
    } else if (client.supports(io.fabric8.kubernetes.api.model.networking.v1.Ingress.class)) {
      io.fabric8.kubernetes.api.model.networking.v1.IngressList ingresses = client.network().v1().ingresses()
          .inNamespace(namespace).list();
      if (ingresses != null && !ingresses.getItems().isEmpty()) {
        return URLFromServiceUtil.getURLFromNetworkingV1IngressList(ingresses.getItems(), namespace, serviceName, port);
      }
    }
    return null;
  
<no_super_class>