I have next hierarchy of classes
   class MyObject {
}
class FirstChild extends MyObject {
}
class SecondChild extends MyObject {
}
class Calculator<T extends MyObject> {
    public Integer calculateValue(T supperObject) {
        return 10;
    }
}
class IntegerCalculator extends Calculator<FirstChild> {
    @Override
    public Integer calculateValue(FirstChild supperObject) {
        return super.calculateValue(supperObject);
    }
}
class SecondChildCalculator extends Calculator<SecondChild> {
    @Override
    public Integer calculateValue(SecondChild supperObject) {
        return super.calculateValue(supperObject);
    }
}
class AbstractUsefulService {
    protected Calculator<? extends MyObject> calculator;
    public AbstractUsefulService(
        Calculator<? extends MyObject> calculator
    ) {
        this.calculator = calculator;
    }
}
class ImplementationOfAbstractUsefulService extends AbstractUsefulService{
    public ImplementationOfAbstractUsefulService(
        SecondChildCalculator calculator
    ) {
        super(calculator);
    }
    public void doJob(){
        calculator.calculateValue(new SecondChild());
    }
}
I have a big problem here calculator.calculateValue(new SecondChild()); - required ? extends MyObject but found SecondChild. I've read a lot of articles and found only one solution and a generic to AbstractUsefulService and use this generic in ConnectionService, but I don't want to do it. How can I resolve my problem without generic in AbstractUsefulService?
 
    