MvvmDelegate { @CallSuper public void onCreate() { final MvvmView<T, S> view = callback.getMvvmView(); final BindingConfig bindingConfig = view.getBindingConfig(); final S viewModel = initViewModel(); final T binding = initBinding(bindingConfig); view.setBinding(binding); view.setViewModel(viewModel); } MvvmDelegate(DelegateCallback<T, S> callback); @CallSuper void onCreate(); @CallSuper void onResume(); @CallSuper void onPause(); @CallSuper void onDestroy();  }
@Test public void testViewModelAttachedToView() { delegate.setCachedViewModel(viewModel); delegate.onCreate(); verify(view).setViewModel(viewModel); }