BooleanArrayDifference extends AbstractDifferenceList implements IDifferenceList { @Override public String toString() { if (differences.size() == 0) return ""; StringBuffer diffBuffer = new StringBuffer(); diffBuffer.append(this.name).append('{'); Iterator<IDifference> children = getChildren().iterator(); while (children.hasNext()) { diffBuffer.append(children.next().toString()); if (children.hasNext()) { diffBuffer.append(", "); } } diffBuffer.append('}'); return diffBuffer.toString(); } private  BooleanArrayDifference(String name); static IDifference construct(String name, boolean[] first, boolean[] second); @Override String toString();  }
@Test public void testToString() { IDifference result = BooleanArrayDifference.construct("Foo", new boolean[]{true}, new boolean[]{false}); String diffString = result.toString(); Assert.assertNotNull(diffString); assertOneLiner(diffString); }