title: Converting Dynamic ArrayList to Json
body: <p>I want to convert an array list to json string of a specific format. I get all the users emails in an array list and want to convert it into the following format of JSON.</p>
  
  <pre><code> [
    {"email":"abc@gmail.com"},
    {"email":"xyz@gmail.com"}
   ]
  </code></pre>
  
  <p>My controller action is </p>
  
  <pre><code> public static Result apiCustomers(){
      List&lt;Customer&gt; customerList = Model.coll(Customer.class).find().toArray();
      List&lt;String&gt; emails = new ArrayList&lt;String&gt;();
  
      for(Customer c : customerList){
          emails.add(c.email);
      }
  
      //ObjectNode result = Json.newObject();
      //result.put("emails", Json.toJson(emails));        
      return ok();
  }
  </code></pre>
  
  <p>How can I convert the emails list to the above json format?</p>
  
  <p>Thanks in advance</p>