I am trying to implement a function with two type parameters `T` and `T1`. 

If the type parameter `T` is an instance of the class `Feed`, I want `T1` to be of class `NewFeed`; if `T` is an instance of the class `Reward`, I want `T1` to be of class `NewReward`. So there is some inherent mapping between `T` and `T1` - how can I express this?

```
public <T> void onServerSuccessGenericList(){
    ArrayList<T1> myArray = myFunction();       // this line causes problem
    ArrayList<T> myArray2 = somefunction()      // hence I need T as well
}

```

I tried the following, but it does not work:

```
public <T> void onServerSuccessGenericList(Class t1ClsName){
    ArrayList<t1ClsName> myArray = myFunction();

}

```