AndroidStateManager implements StateSaver, StateLoader { @Override public void saveBool(String key, boolean value) { bundle.putBoolean(key, value); } AndroidStateManager(Bundle bundle); @Override void saveInt(String key, int value); @Override int loadInt(String key, int defaultIfNotFound); @Override void saveBool(String key, boolean value); @Override boolean loadBool(String key, boolean defaultIfNotFound);  }
@Test public void saveBool_savesTheGivenBoolWithTheGivenKeyInBackingBundle_whenCalled() { Bundle bundle = mock(Bundle.class); AndroidStateManager manager = new AndroidStateManager(bundle); manager.saveBool("key", true); verify(bundle).putBoolean("key", true); }