Imagine this scenario.

```
MyInterface{
    method1();
    method2();
    ...
}

MyImpl1 implements MyInterface{
    ...
}

MyImpl2 implements MyInterface{
    ...
}

SomeOtherClass{
    ...
    public List<MyInterface> foo();
}

Service1{
    public List<Impl1> service1Impl(){
        SomeOtherClass obj = new SomeOtherClass(...); 
        return (List<Impl1>)obj.foo()
    }
}

Service2{
    public List<Impl2> service2Impl(){
        SomeOtherClass obj = new SomeOtherClass(...);
        return (List<Impl2>)obj.foo()
    }
}

```

SomeOtherClass.java's foo() could return either `List<MyImpl1>` or `List<MyImp2>` based on the arguments passed in its constructor. In Service1 lets say it returns `List<Impl1>`, In the case of Service2 class the obj.foo() would return `List<Impl2>`.

Is there a way for me to avoid that explicit type casting? I am thinking of making the Service1's foo() method return List instead of List without type casting it before I return.