### Question:
ComponentActivity extends Activity implements LifecycleOwner { @RestrictTo(LIBRARY_GROUP) public <T extends ExtraData> T getExtraData(Class<T> extraDataClass) { return (T) mExtraDataMap.get(extraDataClass); }  @RestrictTo(LIBRARY_GROUP) void putExtraData(ExtraData extraData); @RestrictTo(LIBRARY_GROUP) T getExtraData(Class<T> extraDataClass); @Override Lifecycle getLifecycle();  }### Answer:
@Test public void testGetExtraData_returnsNullForNotAdded() { assertNull(mComponentActivity.getExtraData(NeverAddedExtraData.class)); }
@Test public void testGetExtraData() { assertEquals(mTestExtraData, mComponentActivity.getExtraData(TestExtraData.class)); }