My case is different but as an example
public interface Comparable<T>
would allow me to say:
public class MyType implements Comparable<OtherType>
but this is rarely what you want to achieve.
Is there a way to force me to say:
public class MyType implements Comparable<MyType>
The closest I got is:
public interface Comparable<T extends Comparable<T>>
This only works partially, as it won't allow OtherType
if it's not comparable itself, but would allow:
public class MyType implements Comparable<Integer>
as it meets the conditions.