private void requestForServer(ServerConfiguration serverConfiguration, List<NotificationConfiguration> configs) { try { Map<String, ZonedDateTime> request = configs.stream() .collect(Collectors.toMap(NotificationConfiguration::projectKey, NotificationTimerTask::getLastNotificationTime, MERGE_TIMES)); NotificationChecker notificationChecker = checkerFactory.create(serverConfiguration); List<SonarQubeNotification> notifications = notificationChecker.request(request); for (SonarQubeNotification n : notifications) { Stream<NotificationConfiguration> matchingConfStream = configs.stream(); if (n.projectKey() != null) { matchingConfStream = matchingConfStream.filter(c -> c.projectKey().equals(n.projectKey())); } matchingConfStream.forEach(c -> { c.listener().handle(n); c.lastNotificationTime().set(n.time()); }); } } catch (Exception e) { LOG.warn("Failed to request SonarQube events to " + serverConfiguration.getUrl(), e); } }