private static boolean is(@NotNull IElementType source, @NotNull Set<IElementType> tokenSet) {
    if (tokenSet.contains(source)) {
      return true;
    }
    if (source instanceof ParentProviderElementType) {
      Set<IElementType> parents = ((ParentProviderElementType)source).getParents();
      return ContainerUtil.exists(parents, parent -> parent != null && is(parent, tokenSet));
    }
    return false;
  }
private static boolean is(@NotNull IElementType source, @NotNull Set<IElementType> tokenSet)