@Test
public void testToDocumentWithBidirectionalBinding() {

  FactRecord record = new FactRecord()
          .setSourceObject(createObjectRecord())
          .setDestinationObject(createObjectRecord())
          .setBidirectionalBinding(true);
  FactDocument document = converter.toDocument(record);
  assertEquals(2, document.getObjects().size());
  assertTrue(document.getObjects().stream().allMatch(o -> ObjectDocument.Direction.BiDirectional == o.getDirection()));
}