What is the definition of the class ActivityInstrumentationTestCase2?
Most likely, ActivityInstrumentationTestCase2 is defined as:
class ActivityInstrumentationTestCase2<T extends SomeObject> { ... }
In this case, the parameters of your object should remain within their parameters of the superclass.
For instance:
public class MyObject<T extends SomeObject> extends ActivityInstrumentationTestCase2<T> { ... }
You can also make the parameter narrower. So, if MySomeObject extended SomeObject, you can also say:
public class MyObject<T extends MySomeObject> extends ActivityInstrumentationTestCase2<T> { ... }
Edit to add: I just found this one . I assume that you are using the same one, so it needs to be defined as:
public class MyObject<T extends android.app.Activity> extends ActivityInstrumentationTestCase2<T> { ... }
source share