boolean (@NotNull ExpressionGenerator generator, @NotNull PsiMethod method, @Nullable GrExpression caller, GrExpression @NotNull [] exprs, GrNamedArgument @NotNull [] namedArgs, GrClosableBlock @NotNull [] closures, @NotNull PsiSubstitutor substitutor, @NotNull GroovyPsiElement context) { if (!method.getName().equals("putAt") && !method.getName().equals("getAt")) return false; final PsiClass clazz = method.getContainingClass(); if (clazz == null) return false; final String qname = clazz.getQualifiedName(); if (!GroovyCommonClassNames.DEFAULT_GROOVY_METHODS.equals(qname)) return false; if (caller == null) return false; final PsiType type = caller.getType(); if (method.getName().equals("getAt")) { if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP)) { GenerationUtil.invokeMethodByName(caller, "get", exprs, namedArgs, closures, generator, context); return true; } else if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_LIST)) { GenerationUtil.invokeMethodByName(caller, "get", exprs, namedArgs, closures, generator, context); return true; } } else if (method.getName().equals("putAt")) { if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP)) { GenerationUtil.invokeMethodByName(caller, "put", exprs, namedArgs, closures, generator, context); return true; } else if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_LIST)) { GenerationUtil.invokeMethodByName(caller, "set", exprs, namedArgs, closures, generator, context); return true; } } return false; }