NavigatingMvvmDialogFragment extends MvvmDialogFragment<S, U> implements FragmentDelegateCallback<S, U>, NavigatingDelegateCallback<T> { @Override protected FragmentDelegate getMvvmDelegate() { if (delegate == null) { delegate = new NavigatingFragmentDelegate<>(this, this, this); } return delegate; }    }
@Test public void testFragmentReturnsNavigatingDelegate() { assertTrue(fragment.getMvvmDelegate() instanceof NavigatingFragmentDelegate); }
@Test public void testCreateDelegateIfNotExestsOnly() { final FragmentDelegate firstDelegate = fragment.getMvvmDelegate(); final FragmentDelegate secondDelegate = fragment.getMvvmDelegate(); assertSame(firstDelegate, secondDelegate); }