Here you can find the source of buildString(Collection
private static String buildString(Collection<String> keys)
//package com.java2s; //License from project: LGPL import java.util.Collection; public class Main { private static final char OPEN_TABLE_SEPARATOR = '['; private static final char CLOSE_TABLE_SEPARATOR = ']'; private static String buildString(Collection<String> keys) { String build = keys.toString(); if (keys.size() == 1) { build = build.replace("" + OPEN_TABLE_SEPARATOR, "").replace("" + CLOSE_TABLE_SEPARATOR, ""); }//from w ww .jav a 2s . c om return build; } }