title: ObjectBox ToOne object is null inside entity only on Android Local Unit Testing
body: <p>I'm trying to write a test for one of my repositories, but I' can't save my Entity object due to the following error:</p>
  
  <pre><code>java.lang.IllegalStateException: ToOne object is null inside br.com.CalendarEvent
  </code></pre>
  
  <p>My Entities are these two:</p>
  
  <pre><code>@Entity
  data class CalendarEvent(
      @Id var boxId: Long = 0,
  
      @Index var id: String = UUID.randomUUID().toString(),
  
      var userId: String = "",
  
      var title: String = "",
  
      var discipline: String = "",
  
      var hour: Int = 1,
  
      var dateInEpochDay: Long = 0L,
  
      var isOnline: Boolean = false,
  
      var estimatedTime: Int = 1,
  
      var userAttended: Boolean? = null) {
  
      lateinit var nucleus: ToOne&lt;SupportNucleus&gt;
  
      lateinit var specialNeeds: ToMany&lt;SpecialNeed&gt;
  
  }
  @Entity
  data class SupportNucleus(
  @Id var boxId: Long = 0,
  
  @Index var id: String = UUID.randomUUID().toString(),
  
  var name: String = "",
  
  var location: String = "",
  
  var contact: String = "",
  
  var phones: String = "",
  
  var startWorkingHour: Int = 9,
  
  var endWorkingHour: Int = 23,
  
  @Transient var unavailableDays: List&lt;Long&gt; = listOf())
  </code></pre>
  
  <p>As you can see both entities have their no-arg constructors, and I works as fine when I'm saving an CalendarEvent running the app or running an instrumented test. This error only occurs on Local Unit Test</p>
  
  <p>My test class:</p>
  
  <pre><code>class CalendarBoxRepositoryTest : BaseObjectBoxTest() {
  
      lateinit var subjectRepository: CalendarRepository
  
      var dataSourceMock: CalendarDataSource = mockk()
      var dataMapperMock: CalendarDataMapper = mockk()
  
      @Before
      fun setup() {
          subjectRepository = CalendarBox(dataSourceMock)
      }
  
  
      @Test
      fun save_calendar_event_correctly() {
          //Given no event was saved
          val calendarBoxBefore = store?.boxFor(CalendarEvent::class.java)
          assertEquals(0, calendarBoxBefore?.all?.size)
  
          val calendar = CalendarEvent(userId = "userId", title = "Title", discipline = "Discipline",
              dateInEpochDay = 123, isOnline = false, estimatedTime = 1, userAttended = null)
  
          val nucleus = SupportNucleus(name = "Support")
  
  
          calendar.nucleus = ToOne(calendar, CalendarEvent_.nucleus)
          calendar.nucleus.target = nucleus
  
          //When Saved
          runBlocking {
              subjectRepository.saveCalendarEvent(calendar)
          }
  
          //Verify saved correctly
          val calendarBoxAfter = store?.boxFor(CalendarEvent::class.java)
          assertEquals(1, calendarBoxAfter?.all?.size)
      }
  }
  </code></pre>
  
  <p>The error actually occurs when I'm trying to fetch after saving to assert that it was saved correctly btw.</p>