Here you can find the source of listToString (final List> l)
public static String listToString (final List<?> l)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file import java.util.Arrays; import java.util.List; public class Main { public static String listToString(final List<?> l) { return Arrays.toString(l.toArray()); }//from w ww . j av a 2 s.c o m /** Varargs wrapper */ public static String toString(final Object... objects) { return Arrays.toString(objects); } }