title: Groovy Converting List of objects to Comma Separated Strings
body: <p>I have a groovy list of CurrencyTypes 
  example </p>
  
  <pre><code>class CurrencyType
  {
      int id;
      def code;
      def currency;
      CurrencyType(int _id, String _code, String _currency)
      {
          id = _id
          code = _code
          currency = _currency
      }
  }
  
  def currenciesList = new ArrayList&lt;CurrencyType&gt;()
  currenciesList.add(new CurrencyType(1,"INR", "Indian Rupee"))
  currenciesList.add(new CurrencyType(1,"USD", "US Dollar"))
  currenciesList.add(new CurrencyType(1,"CAD", "Canadian Dollar")) 
  </code></pre>
  
  <p>I want the list of codes as comma separated values like INR, USD, CAD with minimal code and with out creating new list.</p>