class ExceptionManagerImpl implements ExceptionManager {

    @Override
    public Map<String, IssueException> getIndividualExceptions(String resourceType) throws Exception {
        String indexName = "*_" + resourceType;
        String type = "issue_" + resourceType + "_exception";
        Map<String, Object> mustFilter = new HashMap<>();
        //mustFilter.put("exemptedStatus", "active");

        Map<String, Object> rangeMap = new HashMap<String, Object>();
        rangeMap.put("gte", "now");
        Map<String, Object> dateRangeMap = new HashMap<String, Object>();
        dateRangeMap.put("exceptionEndDate", rangeMap);

        mustFilter.put("range", dateRangeMap);

        List<Map<String, String>> exceptions = ESUtils.getDataFromES(ESUtils.getEsUrl(), indexName, type, mustFilter,
                null, null, null, 0, 20);
        Map<String, IssueException> individualExceptions = exceptions.stream()
                .map(obj -> new IssueException(obj, ExceptionType.INDIVIDUAL))
                .collect(Collectors.toMap(IssueException::getIssueId, obj -> obj, (oldval, newval) -> {
                    logger.error(
                            "duplicate exceptions are found in the system, please fix the source,  ignoring for now --> "
                                    + oldval);
                    return newval;
                }));

        // List<IssueException> stickyExceptions =
        // exceptions.stream().map(obj->new
        // IssueException(obj,ExceptionType.INDIVIDUAL)).collect(Collectors.toList());
        if (null != individualExceptions) {
            logger.info("got " + individualExceptions.size() + " individual exceptions");
        }
        return individualExceptions;
    }

}