title: What is the best method for converting List<String> to String
body: <p>So I've been looking back on code I've written almost a year and a half ago trying to fix it and I found this function that has got me confused. I searched for a method to do the same thing and found a pretty decent function and I'm curious at what would be better.</p>
  
  <p>Function A:</p>
  
  <pre><code>public static String listToString(List&lt;String&gt; list){
      StringBuilder sb = new StringBuilder();
      if (list != null &amp;&amp; list.size() &gt; 1){
          sb.append(list.get(0));
          for (int i = 1; i &lt; list.size(); i++){
              sb.append(", " + list.get(i));
          }
      }else if(list != null &amp;&amp; (list.size() == 1)){
          sb.append(list.get(0));
      }
      return sb.toString();
  }
  </code></pre>
  
  <p>Function B:</p>
  
  <pre><code>public static String listToString(List&lt;String&gt; list) {
      String str = "";
      for (String s : list) {
          str += s + ", ";
      }
      return str;
  }
  </code></pre>
  
  <p>Now I wrote Function A within my first couple months of learning Java so I probably didn't know best though is there any reason I should stick to this method?</p>