MvvmActivity extends AppCompatActivity implements MvvmView<T, S>, ActivityDelegateCallback<T, S> { @NonNull protected ActivityDelegate<T, S> getMvvmDelegate() { if (delegate == null) { delegate = new ActivityDelegate<>(this, this); } return delegate; }  @Override Object onRetainCustomNonConfigurationInstance(); @NonNull @Override MvvmView<T, S> getMvvmView(); @NonNull T getBinding(); @Override @CallSuper void setBinding(@NonNull T binding); @NonNull S getViewModel(); @Override @CallSuper void setViewModel(@NonNull S viewModel);  }
@Test public void testCreateDelegateIfNotExists() { assertNotNull(getTestedActivity().getMvvmDelegate()); }
@Test public void testReturnsSameDelegate() { final MvvmActivity testedActivity = getTestedActivity(); assertSame(testedActivity.getMvvmDelegate(), testedActivity.getMvvmDelegate()); }