Here you can find the source of toString(Collection
static void toString(Collection<byte[]> bytes, Collection<String> result)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { static String toString(byte[] bytes) { return bytes == null ? "NULL_BYTES" : new String(bytes); }//w w w . ja v a 2 s . c o m static void toString(Collection<byte[]> bytes, Collection<String> result) { for (byte[] bs : bytes) { result.add(toString(bs)); } } static List<String> toString(List<byte[]> bytes) { List<String> result = new ArrayList<String>(bytes.size()); toString(bytes, result); return result; } }