void (StringBuilder builder, PsiClass psiClass) { if (psiClass.getContainingClass() != null) return; if (psiClass instanceof PsiAnonymousClass) return; Map<PsiMethod, String> setters = context.getSetters(); Set<Map.Entry<PsiMethod, String>> entries = setters.entrySet(); if (ApplicationManager.getApplication().isUnitTestMode()) { entries = ImmutableSortedSet.copyOf(Map.Entry.comparingByValue(), entries); } for (Map.Entry<PsiMethod, String> entry : entries) { new SetterWriter(builder, psiClass, entry.getKey(), entry.getValue(), classNameProvider, context).write(); } final String name = context.getRefSetterName(); if (name != null) { builder.append("private static <T> T ").append(name). append("(groovy.lang.Reference<T> ref, T newValue) {\nref.set(newValue);\nreturn newValue;\n}"); } }