If you're using Eclipse Collections, you can use the makeString()
method.
ArrayList<String> list = new ArrayList<String>();
list.add("one");
list.add("two");
list.add("three");
Assert.assertEquals(
"one\ttwo\tthree",
ArrayListAdapter.adapt(list).makeString("\t"));
If you can convert your ArrayList
to a FastList
, you can get rid of the adapter.
Assert.assertEquals(
"one\ttwo\tthree",
FastList.newListWith("one", "two", "three").makeString("\t"));
Note: I am a committer for Eclipse Collections.