private static boolean isClassAndFile(@NotNull PsiElement newElement, @NotNull PsiElement oldElement) {
    return isClass(newElement) && isFile(oldElement)
           || isClass(oldElement) && isFile(newElement);
  }
private static boolean isClassAndFile(@NotNull PsiElement newElement, @NotNull PsiElement oldElement)