private static String joinStrings(final Set tags, final String delim) {
        ArrayList<String> strings = new ArrayList<String>(tags);
        String[] objects = strings.toArray(new String[strings.size()]);
        Arrays.sort(objects);
        final StringBuffer sb = new StringBuffer();
        for (final String tag : objects) {
            if (sb.length() > 0) {
                sb.append(delim);
            }
            sb.append(tag);
        }

        return sb.toString();
    }
private static String joinStrings ( final Set tags , final String delim ) { ArrayList < String > strings = new ArrayList < String > ( tags ) ; String [ ] objects = strings . toArray ( new String [ strings . size ( ) ] ) ; Arrays . sort ( objects ) ; final StringBuffer sb = new StringBuffer ( ) ; for ( final String tag : objects ) { if ( sb . length ( ) > 0 ) { sb . append ( delim ) ; } sb . append ( tag ) ; } return sb . toString ( ) ; }
utility to join tags into string

@param tags tags set
@param delim delimiter string

@return joined string