NumberHolder extends AbstractValueHolder { @Override public Long getLong() { return value != null ? Long.valueOf(longValue()) : null; } NumberHolder(BigDecimal value); @Override BigDecimal getValue(); @Override BigDecimal getBigDecimal(); @Override int intValue(); @Override long longValue(); @Override double doubleValue(); @Override Double getDouble(); @Override Integer getInteger(); @Override Long getLong(); @Override String getString();  }
@Test public void testGetLong() { assertEquals(new Long(d1.longValue()), h1.getLong()); assertEquals(new Long(d2.longValue()), h2.getLong()); assertEquals(null, h3.getLong()); }