@Test
public void testToEntityWithBidirectionalBinding() {

  FactRecord record = new FactRecord()
          .setSourceObject(createObjectRecord())
          .setDestinationObject(createObjectRecord())
          .setBidirectionalBinding(true);
  FactEntity entity = converter.toEntity(record);
  assertEquals(2, entity.getBindings().size());
  assertEquals(record.getSourceObject().getId(), entity.getBindings().get(0).getObjectID());
  assertEquals(Direction.BiDirectional, entity.getBindings().get(0).getDirection());
  assertEquals(record.getDestinationObject().getId(), entity.getBindings().get(1).getObjectID());
  assertEquals(Direction.BiDirectional, entity.getBindings().get(1).getDirection());
}