
class GenericsTest2ClassA {
    int field1;

    GenericsTest2ClassA(int value1) {
        self.field1 = value1;
    }

    String method1() {
        return self.field1.toString();
    }
}

class GenericsTest2ClassB extends GenericsTest2ClassA {
    GenericsTest2ClassB(int value1) {
        super(value1);
    }

    void method2() {
        println("method2");
    }
}

class TestGenerics <T extends GenericsTest2ClassA> {
    String call_method2() {
        return self.call_method1();
    }

    String call_method1() {
        T a = new T(111);

        return a.method1();
    }
}

class TestGenerics3 <T extends int> {
    String call_new_operator2() {
        return self.call_new_operator();
    }

    String call_new_operator() {
        T a = new T(123);

        return a.toString();
    }
}

