IntegerDifference implements IDifference { @Override public String toString() { return name + ":" + (first == null ? "NA" : first) + "/" + (second == null ? "NA" : second); } private  IntegerDifference(String name, Integer first, Integer second); static IDifference construct(String name, Integer first, Integer second); @Override String toString();  }
@Test public void testToString() { IDifference result = IntegerDifference.construct("Foo", 1, 2); String diffString = result.toString(); Assert.assertNotNull(diffString); assertOneLiner(diffString); }