private ProblemSummary getProblemSummary(Long executionId, String issueId, Map<String, Object> filterAsMap) { Map<String, List<ProblemSummary>> categorizedProblems = this.getAggregatedIssues(executionId, filterAsMap); List<ProblemSummary> problemSummaries = categorizedProblems.entrySet() .stream() .map(Map.Entry::getValue) .flatMap(Collection::stream) .filter(item -> item.getRuleID().concat(item.getIssueName()).equals(issueId)) .collect(Collectors.toList()); if (problemSummaries.size() == 0) { throw new NotFoundException(); } return problemSummaries.get(0); }