Since you only have to compare the modulus, you don't care about the type parameters.
@Override
public int compareTo(ComplexNumber<?, ?> o) {
return Double.valueOf(modul()).compareTo(Double.valueOf(o.modul()));
}
However, you have to add the wildcards in the type declaration as well
class ComplexNumber <T extends Number,U extends Number> implements Comparable<ComplexNumber<?, ?>>