public static String arrayToString(List list) {
if (list == null) {
throw new IllegalArgumentException("list is null");
}
return list.toString()
.replace("[", "") //remove the right bracket
.replace("]", "") //remove the left bracket
.trim();
}