Using recursive generic types defined in java from scala code
===

I have the following definitions in java code:

An abstract port definition (typed by the concrete port class):

    package test;
    
    public class Port<
         PortOptions extends Port.Options, 
         ConcretePort extends Port<PortOptions, ConcretePort>> {
    
        public interface Options {
        }
    
    }

An port service definition (can do some stuff with the ports via some callback mechanism)

    package test;
    
    import java.util.Set;
    
    public class PortService {
        public interface Callback<T> {
            void processData(T data);
        }
    
        public void methodWithCallback(Callback<Set<Port>> callback) {
    
        }
    }


And i want to register a callback into a port service from scala. What i tried is this:

    package test
    
    import test.PortService.Callback
    import java.util
    
    class PortServiceCaller {
    
        def callingMethod() {
            val portService: PortService = new PortService
    
            portService.methodWithCallback(new Callback[java.util.Set[Port[_, _]]] {
                def processData(data: util.Set[Port[_, _]]) {
    
                }
            })
        }
    }

and it fails miserably with:

    error: type mismatch;
    found   : java.lang.Object with test.PortService.Callback[java.util.Set[test.Port[_, _]]]
    required: test.PortService.Callback[java.util.Set[test.Port[_ <: test.Port.Options, _ <: test.Port[?0,?1]]]]
    portService.methodWithCallback(new Callback[java.util.Set[Port[_, _]]] {

The question is: How to write the scala code in order to let me properly call the java service ?

I have looked over the scala typing system and i can't seem to figure it out.
