@Test
public void testExecuteFunctionForTagEntities()
{

    // Create a list of tag entities.
    final List<TagEntity> tagEntities = Collections.unmodifiableList(Arrays
        .asList(tagDaoTestHelper.createTagEntity(TAG_TYPE, TAG_CODE, TAG_DISPLAY_NAME, TAG_DESCRIPTION),
            tagDaoTestHelper.createTagEntity(TAG_TYPE_2, TAG_CODE_2, TAG_DISPLAY_NAME_2, TAG_DESCRIPTION_2)));
    // Mock the external calls.
    when(jsonHelper.objectToJson(any())).thenReturn(JSON_STRING);
    // Execute a function for all tag entities.
    tagHelper.executeFunctionForTagEntities(SEARCH_INDEX_NAME, tagEntities, (indexName, id, json) -> { });
    // Verify the external calls.
    verify(jsonHelper, times(tagEntities.size())).objectToJson(any());
    verifyNoMoreInteractions(alternateKeyHelper, jsonHelper);
}