void (MapCheckCondition condition, PsiElement result, PsiElement exists, PsiElement none) { PsiMethodCallExpression getCall = condition.extractGetCall(exists); if(getCall == null) return; if(!(none instanceof PsiExpression noneExpression)) return; PsiMethodCallExpression putCall = extractMapMethodCall(noneExpression, "put"); if (mySuggestMapPutIfAbsent && putCall != null && condition.isGetNull() && condition.isMap(putCall.getMethodExpression().getQualifierExpression())) { PsiExpression[] putArgs = putCall.getArgumentList().getExpressions(); if (putArgs.length != 2 || !condition.isKey(putArgs[0]) || !ExpressionUtils.isSafelyRecomputableExpression(putArgs[1])) return; register(condition, holder, false, new ReplaceWithSingleMapOperation("putIfAbsent", getCall, putArgs[1], result)); } if (mySuggestMapGetOrDefault && condition.isContainsKey() && ExpressionUtils.isSafelyRecomputableExpression(noneExpression) && condition.isMapValueType(noneExpression.getType())) { register(condition, holder, false, new ReplaceWithSingleMapOperation("getOrDefault", getCall, noneExpression, result)); } }