@Contract("null, _, _ -> null;!null, _, _ -> !null;")
  @Nullable
  public static PsiElement skipNodeIfNecessary(PsiElement element, EquivalenceDescriptor descriptor, NodeFilter filter) {
    if (element == null) {
      return null;
    }

    /*if (!canSkip(element) && getOnlyNonWhitespaceChild(element) == null) {
      return element;
    }*/

    // todo optimize! (this method is often invoked for the same node)

    if (descriptor == null) {
      final EquivalenceDescriptorProvider provider = EquivalenceDescriptorProvider.getInstance(element);
      if (provider != null) {
        descriptor = provider.buildDescriptor(element);
      }
    }

    if (descriptor != null) {
      final PsiElement onlyChild = getOnlyChildFromDescriptor(descriptor, filter);
      return onlyChild != null ? onlyChild : element;
    }
    return getOnlyChild(element, filter);
  }
@Contract("null, _, _ -> null;!null, _, _ -> !null;")
  @Nullable
  public static PsiElement skipNodeIfNecessary(PsiElement element, EquivalenceDescriptor descriptor, NodeFilter filter)