ActionBarDelegate { @NonNull protected Context getContext() { return context; } protected  ActionBarDelegate(@NonNull final Context context); @Nullable static ActionBarDelegate create(@NonNull final Activity activity); @NonNull static ActionBarDelegate create(@NonNull final Context context, @Nullable final ActionBar actionBar); @NonNull static ActionBarDelegate create(@NonNull final Context context, @Nullable final androidx.appcompat.app.ActionBar actionBar); abstract void setDisplayHomeAsUpEnabled(boolean enabled); abstract void setHomeAsUpIndicator(@DrawableRes int resId); abstract void setHomeAsUpVectorIndicator(@DrawableRes int resId); abstract void setHomeAsUpIndicator(@Nullable Drawable indicator); abstract void setIcon(@DrawableRes int resId); abstract void setIcon(@Nullable Drawable icon); abstract void setTitle(@StringRes int resId); abstract void setTitle(@Nullable CharSequence title);  }
@Test public void testInstantiation() { final Activity activity = new Activity(); final TestDelegate delegate = new TestDelegate(activity); assertThat(delegate.getContext(), Matchers.<Context>is(activity)); }