### Question:
StringOptionFieldAdapter extends ValueOptionFieldAdapter<StringOption> { public static Builder builder() { return new Builder(); } StringOptionFieldAdapter(String nullFormat); static Builder builder();  }### Answer:
@Test public void parse() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); checkParse(adapter, "Hello, world!", new StringOption("Hello, world!")); }
@Test public void parse_empty() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); checkParse(adapter, "", new StringOption("")); }
@Test public void parse_null() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().withNullFormat("").build(); checkParse(adapter, "", new StringOption()); }
@Test public void parse_surrogate_pair() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); checkParse(adapter, CP_BEER, new StringOption(CP_BEER)); }
@Test public void parse_overflow() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); StringBuilder buf = new StringBuilder(); for (int i = 0; i < 257; i++) { buf.append('a'); } checkParse(adapter, buf.toString(), new StringOption(buf.toString())); }
@Test public void parse_broken() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); checkMalformed(adapter, String.valueOf(CP_BEER.charAt(0)), new StringOption()); }
@Test public void emit() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); checkEmit(adapter, new StringOption("Hello, world!"), "Hello, world!"); }
@Test public void emit_empty() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); checkEmit(adapter, new StringOption(""), ""); }
@Test public void emit_null() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().build(); checkEmit(adapter, new StringOption(), null); }
@Test public void emit_null_formatted() { StringOptionFieldAdapter adapter = StringOptionFieldAdapter.builder().withNullFormat("null").build(); checkEmit(adapter, new StringOption(), "null"); }