TitleBuffer { public TitleBuffer append(final int number) { append(String.valueOf(number)); return this; } TitleBuffer();  TitleBuffer(final Object object);  TitleBuffer(final Object object, final String defaultTitle);  TitleBuffer(final String text); static boolean isEmpty(final Object object); static boolean isEmpty(final String text); TitleBuffer append(final int number); TitleBuffer append(final Object object); TitleBuffer append(final Object object, final String defaultValue); TitleBuffer append(final String text); TitleBuffer append(final String joiner, final Object object); TitleBuffer append(final String joiner, final Object object, final String defaultTitle); TitleBuffer append(final String joiner, final String text); TitleBuffer appendSpace(); final TitleBuffer concat(final Object object); final TitleBuffer concat(final Object object, final String defaultValue); final TitleBuffer concat(final String text); TitleBuffer concat(final String joiner, final String text); final TitleBuffer concat(final String joiner, final Object object); final TitleBuffer concat(final String joiner, final Object object, final String defaultValue); @Override String toString(); TitleBuffer truncate(final int noWords);  }
@Test public void testAppend() { t1.append(""); assertEquals("add empty string", name, t1.toString()); t1.append("Smith"); name += (" " + "Smith"); assertEquals("append simple string", name, t1.toString()); t1.append(",", ""); assertEquals("append empty string with delimiter", name, t1.toString()); t1.append(",", null); assertEquals("append null with delimiter", name, t1.toString()); t1.append(",", "Xyz Ltd."); name += (", " + "Xyz Ltd."); assertEquals("append string with delimiter", name, t1.toString()); }