boolean (@NotNull Project project, @NotNull Class<? extends BadGitExecutableNotification> notificationType) { BadGitExecutableNotification[] currentNotifications = getNotificationsManager().getNotificationsOfType(BadGitExecutableNotification.class, project); int notificationsCount = currentNotifications.length; if (notificationsCount <= 0) { return true; } for (int i = 0; i < notificationsCount - 1; i++) { currentNotifications[i].expire(); } BadGitExecutableNotification lastNotification = currentNotifications[notificationsCount - 1]; if (lastNotification.getClass() != notificationType) { lastNotification.expire(); return true; } return false; }