### Question:
FactTypeHelper { public Set<FactTypeEntity.FactObjectBindingDefinition> convertFactObjectBindingDefinitions(List<FactObjectBindingDefinition> bindingDefinitions) { if (CollectionUtils.isEmpty(bindingDefinitions)) return null; return bindingDefinitions.stream() .map(r -> new FactTypeEntity.FactObjectBindingDefinition() .setSourceObjectTypeID(r.getSourceObjectType()) .setDestinationObjectTypeID(r.getDestinationObjectType()) .setBidirectionalBinding(r.isBidirectionalBinding())) .collect(Collectors.toSet()); } @Inject  FactTypeHelper(FactManager factManager, ObjectManager objectManager); void assertFactTypeNotExists(String name); void assertObjectTypesToBindExist(List<FactObjectBindingDefinition> bindingDefinitions, String propertyName); void assertFactTypesToBindExist(List<MetaFactBindingDefinition> bindingDefinitions, String propertyName); Set<FactTypeEntity.FactObjectBindingDefinition> convertFactObjectBindingDefinitions(List<FactObjectBindingDefinition> bindingDefinitions); Set<FactTypeEntity.MetaFactBindingDefinition> convertMetaFactBindingDefinitions(List<MetaFactBindingDefinition> bindingDefinitions);  }### Answer:
@Test public void testConvertFactObjectBindingDefinitionsWithoutBindings() { assertNull(helper.convertFactObjectBindingDefinitions(null)); assertNull(helper.convertFactObjectBindingDefinitions(ListUtils.list())); }
@Test public void testConvertFactObjectBindingDefinitionsWithBindings() { FactObjectBindingDefinition request1 = new FactObjectBindingDefinition() .setSourceObjectType(UUID.randomUUID()) .setDestinationObjectType(UUID.randomUUID()) .setBidirectionalBinding(false); FactObjectBindingDefinition request2 = new FactObjectBindingDefinition() .setSourceObjectType(UUID.randomUUID()) .setDestinationObjectType(UUID.randomUUID()) .setBidirectionalBinding(true); FactTypeEntity.FactObjectBindingDefinition entity1 = new FactTypeEntity.FactObjectBindingDefinition() .setSourceObjectTypeID(request1.getSourceObjectType()) .setDestinationObjectTypeID(request1.getDestinationObjectType()) .setBidirectionalBinding(request1.isBidirectionalBinding()); FactTypeEntity.FactObjectBindingDefinition entity2 = new FactTypeEntity.FactObjectBindingDefinition() .setSourceObjectTypeID(request2.getSourceObjectType()) .setDestinationObjectTypeID(request2.getDestinationObjectType()) .setBidirectionalBinding(request2.isBidirectionalBinding()); assertEquals(SetUtils.set(entity1, entity2), helper.convertFactObjectBindingDefinitions(ListUtils.list(request1, request2))); }