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