### Question:
ShortOptionFieldAdapter extends NumericOptionFieldAdapter<ShortOption> { public static Builder builder() { return new Builder(); } ShortOptionFieldAdapter(String nullFormat, DecimalFormat decimalFormat); static Builder builder();  }### Answer:
@Test public void parse() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder().build(); checkParse(adapter, 0, new ShortOption((short) 0)); checkParse(adapter, 1, new ShortOption((short) 1)); checkParse(adapter, -1, new ShortOption((short) -1)); checkParse(adapter, Short.MAX_VALUE, new ShortOption(Short.MAX_VALUE)); checkParse(adapter, Short.MIN_VALUE, new ShortOption(Short.MIN_VALUE)); }
@Test public void parse_overflow() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder().build(); checkMalformed(adapter, BigInteger.valueOf(Short.MAX_VALUE).add(BigInteger.ONE).toString(), new ShortOption()); }
@Test public void parse_empty() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder().build(); checkMalformed(adapter, "", new ShortOption()); }
@Test public void parse_null() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder().withNullFormat("").build(); checkParse(adapter, "", new ShortOption()); }
@Test public void emit() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder().build(); checkEmit(adapter, new ShortOption((short) 1), 1); checkEmit(adapter, new ShortOption((short) -1), -1); }
@Test public void emit_null() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder().build(); checkEmit(adapter, new ShortOption(), null); }
@Test public void emit_null_formatted() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder().withNullFormat("").build(); checkEmit(adapter, new ShortOption(), ""); }
@Test public void number_format() { ShortOptionFieldAdapter adapter = ShortOptionFieldAdapter.builder() .withNumberFormat("0,000") .build(); checkParse(adapter, 0, new ShortOption((short) 0)); checkParse(adapter, 1, new ShortOption((short) 1)); checkParse(adapter, -1, new ShortOption((short) -1)); checkParse(adapter, Short.MAX_VALUE, new ShortOption(Short.MAX_VALUE)); checkParse(adapter, Short.MIN_VALUE, new ShortOption(Short.MIN_VALUE)); checkMalformed(adapter, "", new ShortOption()); checkMalformed(adapter, "Hello, world!", new ShortOption()); checkMalformed(adapter, BigInteger.valueOf(Short.MAX_VALUE).add(BigInteger.ONE).toString(), new ShortOption()); checkEmit(adapter, new ShortOption((short) 1), "0,001"); checkEmit(adapter, new ShortOption((short) -1), "-0,001"); checkEmit(adapter, new ShortOption((short) 1000), "1,000"); checkEmit(adapter, new ShortOption((short) 10000), "10,000"); }