private static @Nullable PsiElement next(final @NotNull PsiElement element) {
    for (PsiElement anchor = element; anchor != null; anchor = anchor.getParent()) {
      final PsiElement result = element.getNextSibling();
      if (result != null) {
        return result;
      }
    }
    return null;
  }
private static @Nullable PsiElement next(final @NotNull PsiElement element)