IntegerHolder extends AbstractValueHolder { @Override public Long getValue() { return value; } IntegerHolder(Long value); @Override Long getValue(); @Override int intValue(); @Override long longValue(); @Override BigDecimal getBigDecimal(); @Override Integer getInteger(); @Override Long getLong();  }
@Test public void testGetValue() { assertEquals(long1, h1.getValue()); assertEquals(long2, h2.getValue()); assertNull(h3.getValue()); }
@Test public void testCompareTo() { IntegerHolder[] array = { new IntegerHolder(999L), new IntegerHolder(222L), new IntegerHolder(null), new IntegerHolder(888L), new IntegerHolder(null) }; Long[] expectedResult = { null, null, 222L, 888L, 999L }; Arrays.sort(array); for (int i = 0; i < array.length; i++) { Long value = array[i].getValue(); Long expected = expectedResult[i]; assertEquals(expected, value); } }