Realm Exception 'value' is not a valid managed object : <p>I'm setting a property on a realm object with another realm object which is a different class, however I'm getting the error: 'value' is not avalid managed object.</p>

<pre><code>realmObject.setAnotherRealmObject(classInstance.returnAnotherRealmObjectWithValues())
</code></pre>

<p>The class instance receives anotherRealmObject constructor and returns it through the method with values from widgets:</p>

<pre><code>public ClassInstance(AnotherRealmObject anotherRealmObject){
  mAnotherRealmObject = anotherRealmObject;
}

public AnotherRealmObject returnAnotherRealmObjectWithValues(){
       mAnotherRealmObject.setId(RandomUtil.randomNumbersAndLetters(5));
       mAnotherRealmObject.setName(etName.getText().toString());

       return mAnotherRealmObject;
}
</code></pre>

<p>I'm creating the new Another Realm Object the right way (I think):</p>

<pre><code>mAnotherRealmObject = mRealmInstance.createObject(AnotherRealmObject.class);
</code></pre>

<p>Is it because I'm returning anotherRealmObject wherein it is already modified because of the passing reference?</p>
