private static boolean isEquivalentInstanceOf(@NotNull PsiInstanceOfExpression pattern, @NotNull PsiInstanceOfExpression candidate) {
    final PsiTypeElement operand1 = pattern.getCheckType();
    final PsiTypeElement operand2 = candidate.getCheckType();
    if (operand1 == null || operand2 == null) return false;
    if (!operand1.getType().equals(operand2.getType())) return false;
    return true;
  }
private static boolean isEquivalentInstanceOf(@NotNull PsiInstanceOfExpression pattern, @NotNull PsiInstanceOfExpression candidate)