void (@NotNull Project project, PsiClass aClass, List<String> nonNullNames) { String permitsClause = StreamEx.of(nonNullNames).sorted().joining(",", "permits ", ""); PsiReferenceList permitsList = createPermitsClause(project, permitsClause); PsiReferenceList implementsList = Objects.requireNonNull(aClass.getImplementsList()); aClass.addAfter(permitsList, implementsList); }