@Nullable
  InlineTransformer getTransformer(PsiReference ref) {
    if (!(ref instanceof PsiReferenceExpression)) return null;
    PsiMethodCallExpression call = ObjectUtils.tryCast(((PsiReferenceExpression)ref).getParent(), PsiMethodCallExpression.class);
    if (call == null) return null;
    boolean wantedValue = true;
    PsiElement parent;
    PsiExpression expression = call;
    while (true) {
      parent = PsiUtil.skipParenthesizedExprUp(expression.getParent());
      if (parent instanceof PsiPrefixExpression && JavaTokenType.EXCL.equals(((PsiPrefixExpression)parent).getOperationTokenType())) {
        wantedValue = !wantedValue;
        expression = (PsiPrefixExpression)parent;
      }
      else {
        break;
      }
    }
    if (parent instanceof PsiIfStatement ifStatement) {
      PsiStatement thenStatement = ControlFlowUtils.stripBraces(ifStatement.getThenBranch());
      PsiStatement elseStatement = ControlFlowUtils.stripBraces(ifStatement.getElseBranch());
      if (elseStatement == null && wantedValue == myEarlyReturnValue) {
        boolean allowReplacement;
        if (myEarlyReturnValueCount == 1 && myTerminalNonRemovableValueCount == 0) {
          allowReplacement = isJumpOut(thenStatement);
        }
        else {
          allowReplacement = isCopyableJumpOut(thenStatement);
        }
        if (allowReplacement) {
          return getTransformer(thenStatement, null);
        }
      }
      if (isJumpOut(thenStatement) && isJumpOut(elseStatement) && myTerminalNonRemovableValueCount == 0 && myEarlyReturnValueCount == 1) {
        PsiStatement earlyStatement = myEarlyReturnValue == wantedValue ? thenStatement : elseStatement;
        PsiStatement finalStatement = myEarlyReturnValue != wantedValue ? thenStatement : elseStatement;
        return getTransformer(earlyStatement, finalStatement);
      }
    }
    return null;
  }
@Nullable
  InlineTransformer getTransformer(PsiReference ref)