StringHolder extends AbstractValueHolder { @Override public String getValue() { return value; } StringHolder(String value); @Override String getValue();  }
@Test public void testGetValue() { assertEquals("abc", h1.getValue()); assertNull(h2.getValue()); }
@Test public void testCompareTo() { StringHolder[] array = { new StringHolder("DF"), new StringHolder(null), new StringHolder("Ab"), new StringHolder("z"), new StringHolder("AB"), new StringHolder("") }; String[] expectedResult = { null, "", "AB", "Ab", "DF", "z" }; Arrays.sort(array); for (int i = 0; i < array.length; i++) { String value = array[i].getValue(); String expected = expectedResult[i]; assertEquals(expected, value); } }