AndroidStateManager implements StateSaver, StateLoader { @Override public void saveInt(String key, int value) { bundle.putInt(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 saveInt_savesTheGivenIntWithTheGivenKeyInBackingBundle_whenCalled() { Bundle bundle = mock(Bundle.class); AndroidStateManager manager = new AndroidStateManager(bundle); manager.saveInt("key", 1); verify(bundle).putInt("key", 1); }