private static boolean isValidElementRange(@Nullable Pair<PsiElement, PsiElement> elementRange) {
    if (elementRange == null) {
      return false;
    }
    return elementRange.getFirst().getParent() == elementRange.getSecond().getParent();
  }
private static boolean isValidElementRange(@Nullable Pair<PsiElement, PsiElement> elementRange)