StringBundler implements Serializable { public static String concat(Object... objects) { String[] strings = new String[objects.length]; for (int i = 0; i < objects.length; i++) { strings[i] = String.valueOf(objects[i]); } return _toString(strings, strings.length); } StringBundler();  StringBundler(int initialCapacity);  StringBundler(String s);  StringBundler(String[] stringArray);  StringBundler(String[] stringArray, int extraSpace); static String concat(Object... objects); static String concat(String... strings); StringBundler append(boolean b); StringBundler append(char c); StringBundler append(char[] chars); StringBundler append(double d); StringBundler append(float f); StringBundler append(int i); StringBundler append(long l); StringBundler append(Object object); StringBundler append(String s); StringBundler append(String[] stringArray); StringBundler append(StringBundler sb); int capacity(); String[] getStrings(); int index(); int length(); void setIndex(int newIndex); void setStringAt(String s, int index); String stringAt(int index); @Override String toString(); void writeTo(Writer writer);  }
@Test public void testConcatObjects() { Assert.assertSame("test1", StringBundler.concat((Object)"test1")); Assert.assertSame( StringPool.NULL, StringBundler.concat(new Object[] {null})); Assert.assertEquals( "test1test2", StringBundler.concat((Object)"test1", "test2")); Assert.assertEquals( "test1test2test3", StringBundler.concat("test1", (Object)"test2", "test3")); Assert.assertEquals( "test1test2test3test4", StringBundler.concat("test1", "test2", "test3", (Object)"test4")); }
@Test public void testConcatStrings() { Assert.assertSame("test1", StringBundler.concat("test1")); Assert.assertSame( StringPool.NULL, StringBundler.concat(new String[] {null})); Assert.assertEquals( "test1test2", StringBundler.concat("test1", "test2")); Assert.assertEquals("abcdef", StringBundler.concat("a", "bc", "def")); Assert.assertEquals("abcdef", StringBundler.concat("abc", "de", "f")); Assert.assertEquals( "test1test2test3test4", StringBundler.concat("test1", "test2", "test3", "test4")); }