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