
abstract class Generics10Numeric <T> {
    abstract T plus(T value);
    abstract T minus(T value);
}

class Generics10Operator <T, T2, T3 extends Generics10Numeric<T2>> {
    T2 call_plus_method(T3 a, T2 b) {
        return a.plus(b);
    }
}

class GenericsTestInteger extends Generics10Numeric<GenericsTestInteger> {
    int value;

    GenericsTestInteger(int value) {
        self.value = value;
    }

    void call_plus_method() {
        println("plus --> " + self.plus(self).value.toString());
    }

    virtual GenericsTestInteger plus(GenericsTestInteger integer) {
        return new GenericsTestInteger(self.value + integer.value);
    }
    virtual GenericsTestInteger minus(GenericsTestInteger integer) {
        return new GenericsTestInteger(self.value - integer.value);
    }
}

class Generics10Float extends Generics10Numeric<Generics10Float> {
    float value;

    Generics10Float(float value) {
        self.value = value;
    }

    virtual Generics10Float plus(Generics10Float float) {
        return new Generics10Float(self.value + float.value);
    }
    virtual Generics10Float minus(Generics10Float float) {
        return new Generics10Float(self.value - float.value);
    }
}
