title: Convert List to JsonObject in Java using json simple
body: <p>I have a list -</p>
  
  <pre><code>List&lt;Item&gt; items = new ArrayList&lt;Item&gt;;
  </code></pre>
  
  <p>which consists of items - <strong>[firstname , abc , lastname , pqr , id , 1 ]</strong></p>
  
  <p>I need to convert this list to JSONObject of below format in java using json simple lib -</p>
  
  <p><strong>{"firstname":"abc","lastname":"pqr","id":"1"}</strong></p>
  
  <p>How can I achieve this?
  I am just a beginner.Any help would be appreciated.Thankyou in advance.</p>