class BusinessObjectDefinitionHelper {

    public void executeFunctionForBusinessObjectDefinitionEntities(final String indexName,
        final List<BusinessObjectDefinitionEntity> businessObjectDefinitionEntities, final TriConsumer<String, String, String> function)
    {
        // For each business object definition apply the passed in function
        businessObjectDefinitionEntities.forEach(businessObjectDefinitionEntity ->
        {
            // Fetch Join with .size()
            businessObjectDefinitionEntity.getAttributes().size();
            businessObjectDefinitionEntity.getBusinessObjectDefinitionTags().size();
            businessObjectDefinitionEntity.getBusinessObjectFormats().size();
            businessObjectDefinitionEntity.getColumns().size();
            businessObjectDefinitionEntity.getSampleDataFiles().size();
            businessObjectDefinitionEntity.getSubjectMatterExperts().size();

            // Convert the business object definition entity to a JSON string
            final String jsonString = safeObjectMapperWriteValueAsString(businessObjectDefinitionEntity);

            if (StringUtils.isNotEmpty(jsonString))
            {
                // Call the function that will process each business object definition entity against the index
                try
                {
                    function.accept(indexName, businessObjectDefinitionEntity.getId().toString(), jsonString);
                }
                catch (Exception ex)
                {
                    LOGGER.warn("Index operation exception is logged {} for {}, {}, {}", ex, indexName, businessObjectDefinitionEntity.getId().toString(),
                        jsonString);
                }
            }
        });

        LOGGER.info("Finished processing {} business object definitions with a search index function.", businessObjectDefinitionEntities.size());
    }

}