question: public String toCommaSeparatedString ( ) { String result = "" ; for ( int i = 0 ; i < contents . size ( ) ; i ++ ) { if ( result . equals ( "" ) ) { result = contents . elementAt ( i ) ; } else { result = result + ", " + contents . elementAt ( i ) ; } } return result ; }
target:  Returns the comma-separated list of all the elements of the list. It returns "" if the set is empty.