Take for instance, the method below.

```
<T extends MyInterface> void myFunction(Class<T>... types) {
    // Do some stuff that requires T to implement MyInterface
}

```

Now, given the method call below assuming `MyClass1` and `MyClass2` both implement `MyInterface`.

```
myFunction(MyClass1.class, MyClass2.class)

```

I get the following error.

> 
> Incompatible equality constraint: MyClass1 and MyClass2
> 
> 
> 

How do I make this work? More specifically, how would one use a variadic parameter of class types implementing an interface in Java?