public @Nullable ErrorTreeElement getFirstMessage(@NotNull ErrorTreeElementKind kind) {
    if (shouldHide(kind)) {
      return null; // elements of this kind are hidden
    }
    synchronized (myLock) {
      final List<ErrorTreeElement> simpleMessages = mySimpleMessages.get(kind);
      if (simpleMessages != null && !simpleMessages.isEmpty()) {
        return simpleMessages.get(0);
      }
      for (final String path : myGroupNames) {
        final List<NavigatableMessageElement> messages = myGroupNameToMessagesMap.get(path);
        if (messages != null) {
          for (final NavigatableMessageElement navigatableMessageElement : messages) {
            if (kind.equals(navigatableMessageElement.getKind())) {
              return navigatableMessageElement;
            }
          }
        }
      }
    }
    return null;
  }
public @Nullable ErrorTreeElement getFirstMessage(@NotNull ErrorTreeElementKind kind)