### Question:
ClipboardModule extends ContextBaseJavaModule { @ReactMethod public void setString(String text) { ClipData clipdata = ClipData.newPlainText(null, text); ClipboardManager clipboard = getClipboardService(); clipboard.setPrimaryClip(clipdata); } ClipboardModule(Context context); @Override String getName(); @ReactMethod void getString(Promise promise); @ReactMethod void setString(String text); static final String NAME; }### Answer:
@Test public void testSetString() { mClipboardModule.setString(TEST_CONTENT); assertTrue(mClipboardManager.getText().equals(TEST_CONTENT)); mClipboardModule.setString(null); assertFalse(mClipboardManager.hasText()); mClipboardModule.setString(""); assertFalse(mClipboardManager.hasText()); mClipboardModule.setString(" "); assertTrue(mClipboardManager.hasText()); }