ViewModelCache { public MvvmViewModel getViewModel(int key, @NonNull Context context) { return getFragment(context).get(key); }  MvvmViewModel getViewModel(int key, @NonNull Context context); void putViewModel(int key, MvvmViewModel cacheViewModel, Context context); void removeViewModel(int key, Context context); void cleanUp();  }
@Test(expected = IllegalStateException.class) public void testFailIfContextNotContainsFragmentActivity() { Activity activity = Robolectric.buildActivity(Activity.class).create().get(); cache.getViewModel(1, activity); }