public boolean hasMessages(@NotNull Set<ErrorTreeElementKind> kinds, Predicate<? super ErrorTreeElement> filter) {
    synchronized (myLock) {
      for (Map.Entry<ErrorTreeElementKind, List<ErrorTreeElement>> entry : mySimpleMessages.entrySet()) {
        if (kinds.contains(entry.getKey())) {
          final List<ErrorTreeElement> messages = entry.getValue();
          if (messages != null && !messages.isEmpty()) {
            for (ErrorTreeElement message : messages) {
              if (filter.test(message)) {
                return true;
              }
            }
          }
        }
      }
      for (Map.Entry<String, List<NavigatableMessageElement>> entry : myGroupNameToMessagesMap.entrySet()) {
        final List<NavigatableMessageElement> messages = entry.getValue();
        if (messages != null && !messages.isEmpty()) {
          for (NavigatableMessageElement message : messages) {
            if (filter.test(message) && kinds.contains(message.getKind())) {
              return true;
            }
          }
        }
      }
    }
    return false;
  }
public boolean hasMessages(@NotNull Set<ErrorTreeElementKind> kinds, Predicate<? super ErrorTreeElement> filter)