ActivityDelegate { @NonNull protected final Activity getActivity() { return activity; } protected  ActivityDelegate(@NonNull final Activity activity); @NonNull static ActivityDelegate create(@NonNull final Activity activity); abstract boolean requestWindowFeature(int featureId); abstract void invalidateOptionsMenu(); @Nullable abstract ActionBar getActionBar(); @Nullable abstract androidx.appcompat.app.ActionBar getSupportActionBar(); @Nullable abstract ActionMode startActionMode(@NonNull ActionMode.Callback callback);  }
@Test public void testInstantiation() { final Activity activity = new Activity(); final TestDelegate delegate = new TestDelegate(activity); assertThat(delegate.getActivity(), is(activity)); }