class UnitGraphInfoLoader {

    public Set<String> selectUnitsByIdsAndAccessContract(MetaDataClient metaDataClient, Set<String> unitIds,
        AccessContractModel accessContractModel)
        throws InvalidParseOperationException, InvalidCreateOperationException, VitamDBException,
        MetaDataDocumentSizeException, MetaDataExecutionException, MetaDataClientServerException {

        Set<String> foundUnitIds = new HashSet<>();

        for (List<String> ids : ListUtils.partition(new ArrayList<>(unitIds), MAX_ELASTIC_SEARCH_IN_REQUEST_SIZE)) {

            SelectMultiQuery select = new SelectMultiQuery();
            select.setQuery(QueryHelper.in(VitamFieldsHelper.id(), ids.toArray(new String[0])));

            foundUnitIds.addAll(selectUnitsByQueryDslAndAccessContract(metaDataClient, select, accessContractModel));
        }
        return foundUnitIds;
    }

}