title: Java object to JSON with org.json lib
body: <p>I have class like this:</p>
  
  <pre><code>public class Class1 {
      private String result;
      private String ip;
      private ArrayList&lt;Class2&gt; alarm;
  }
  </code></pre>
  
  <p>Where Alarm its a class like this:</p>
  
  <pre><code>public class Class2 {
      private String bla;
      private String bla1;
  }
  </code></pre>
  
  <p>Is there easy way to convert instance of Class1 to JSON object with org.json?</p>