### Question:
TypeEditor { public T put(ValueType value) { putValue(target.editor(), key, value); return target; } protected  TypeEditor(T target, SharedPreferences sharedPreferences, String key); T put(ValueType value); @TargetApi(Build.VERSION_CODES.GINGERBREAD) void save(ValueType value); ValueType getOr(ValueType def); T remove();  }### Answer:
@Test public void testPutApply() { String mockValue = "Giang"; mTypeEditor.put(mockValue); verify(mMockEditor, never()).apply(); mTypeEditor.put(mockValue).apply(); verify(mMockEditor).apply(); }
@Test public void testPutCommit() { String mockValue = "Giang"; mTypeEditor.put(mockValue); verify(mMockEditor, never()).commit(); mTypeEditor.put(mockValue).commit(); verify(mMockEditor).commit(); }