title: insert or update values from retrofit to realm
body: <p>I am getting arraylist from retrofit with my custom class. I converted the same class to realm by extending <code>RealmObject</code>. But I am unable to add data or create object . How can I write/update the same data to realm?</p>
  
  <p>My retrofit callback:  </p>
  
  <pre><code>Callback&lt;ArrayList&lt;CustomModel&gt;&gt; callback);
  </code></pre>
  
  <p>Retrofit code:</p>
  
  <pre><code> @Override
              public void success(ArrayList&lt;CustomModel&gt; mycustomListModel, Response response) {
  
                          realm.beginTransaction();
                          realm.copyToRealmOrUpdate(mycustomListModel);
                          realm.commitTransaction();
  }
  </code></pre>