@Nullable
  private static Trinity<PsiClassType, GrReferenceExpression, List<GrMethod>> doGetClosureMixins(@NotNull GrAssignmentExpression assignment) {
    // Integer.class.metaClass.foo = {}
    final GrExpression lValue = assignment.getLValue(); // Integer.class.metaClass.foo
    if (!(lValue instanceof GrReferenceExpression)) {
      return null;
    }

    final String mixedMethodName = ((GrReferenceExpression)lValue).getReferenceName(); // foo
    if (mixedMethodName == null) {
      return null;
    }

    final GrExpression metaClassExpression = ((GrReferenceExpression)lValue).getQualifier(); // Integer.class.metaClass
    if (!(metaClassExpression instanceof GrReferenceExpression)) {
      return null;
    }

    final GrExpression rValue = assignment.getRValue(); // {}
    if (rValue == null) {
      return null;
    }

    final PsiElement resolved = ((GrReferenceExpression)metaClassExpression).resolve(); // getMetaClass
    if (!(resolved instanceof PsiMethod) || !isMetaClassMethod((PsiMethod)resolved)) {
      return null;
    }

    final GrExpression classQualifier = ((GrReferenceExpression)metaClassExpression).getQualifier(); // Integer.class
    final Pair<PsiClassType, GrReferenceExpression> original = getPsiClassFromReference(classQualifier);
    if (original == null) {
      return null;
    }

    final PsiType type = rValue.getType();
    if (!(type instanceof GroovyClosureType)) {
      return null;
    }

    final PsiClass closure = JavaPsiFacade.getInstance(assignment.getProject()).findClass(
      GroovyCommonClassNames.GROOVY_LANG_CLOSURE, assignment.getResolveScope()
    );
    if (closure == null) return null;

    final List<GrMethod> methods = new ArrayList<>();
    for (CallSignature<?> signature : ((GroovyClosureType)type).getSignatures()) {
      methods.add(createMethod(signature, mixedMethodName, assignment, closure));
    }
    return Trinity.create(original.first, original.second, methods);
  }
@Nullable
  private static Trinity<PsiClassType, GrReferenceExpression, List<GrMethod>> doGetClosureMixins(@NotNull GrAssignmentExpression assignment)