private void addTextToString(String text,StringBuilder stringBuilder){
  if (stringBuilder.length() > 0) {
    stringBuilder.append(", ");
  }
  stringBuilder.append(text);
}

private void addTextToString ( String text , StringBuilder stringBuilder ) { if ( stringBuilder . length ( ) > 0 ) { stringBuilder . append ( ", " ) ; } stringBuilder . append ( text ) ; }
adds text to the string builder and inserting a preceding comma if text already exists in the builder .
