void (@NotNull ActionContext context, @NotNull PsiClass element, @NotNull ModPsiUpdater updater) { if (!(element.getContainingClass() instanceof PsiUnnamedClass unn)) return; PsiMember[] members = PsiTreeUtil.getChildrenOfType(unn, PsiMember.class); if (members == null) return; List<PsiMember> membersWithoutClasses = Arrays.stream(members).filter(member -> !(member instanceof PsiClass)).toList(); for (PsiMember member : membersWithoutClasses) { PsiElement copyMember = member.copy(); member.delete(); element.add(copyMember); } }