@Test
public void testConvertFactWithInReferenceToFact() {

  FactRecord record = createRecord().setInReferenceToID(UUID.randomUUID());
  FactRecord inReferenceTo = new FactRecord().setId(record.getInReferenceToID());
  when(objectFactDao.getFact(record.getInReferenceToID())).thenReturn(inReferenceTo);
  when(securityContext.hasReadPermission(inReferenceTo)).thenReturn(true);
  Fact model = converter.apply(record);
  assertNotNull(model.getInReferenceTo());
  assertEquals(record.getInReferenceToID(), model.getInReferenceTo().getId());
  verify(securityContext).hasReadPermission(inReferenceTo);
}