MvvmFragment extends Fragment implements MvvmView<T, S>, FragmentDelegateCallback<T, S> { @NonNull public S getViewModel() { if (viewModel == null) { throw new IllegalStateException("You can't call getViewModel() before fragment creating."); } return viewModel; }  @Override @CallSuper void onCreate(@Nullable Bundle savedInstanceState); @Nullable @Override View onCreateView(LayoutInflater inflater,
                             @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState); @Override @CallSuper void onResume(); @Override @CallSuper void onPause(); @Override @CallSuper void onDestroy(); @Override @CallSuper void onSaveInstanceState(Bundle outState); @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(expected = IllegalStateException.class) public void testNotAllowUseViewModelBeforeCreation() { getTestedFragment().getViewModel(); }