void (PsiClass anInterface) { final PsiIdentifier nameIdentifier = anInterface.getNameIdentifier(); assert nameIdentifier != null; final PsiElement whiteSpace = nameIdentifier.getPrevSibling(); assert whiteSpace != null; final PsiElement interfaceToken = whiteSpace.getPrevSibling(); assert interfaceToken != null; final PsiKeyword interfaceKeyword = (PsiKeyword)interfaceToken.getOriginalElement(); final Project project = anInterface.getProject(); final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); final PsiElementFactory factory = psiFacade.getElementFactory(); final PsiKeyword classKeyword = factory.createKeyword("class"); interfaceKeyword.replace(classKeyword); final PsiModifierList classModifierList = anInterface.getModifierList(); if (classModifierList == null) { return; } classModifierList.setModifierProperty(PsiModifier.ABSTRACT, true); final PsiElement parent = anInterface.getParent(); if (parent instanceof PsiClass) { classModifierList.setModifierProperty(PsiModifier.STATIC, true); } final PsiMethod[] methods = anInterface.getMethods(); for (final PsiMethod method : methods) { PsiUtil.setModifierProperty(method, PsiModifier.PUBLIC, true); if (method.hasModifierProperty(PsiModifier.DEFAULT)) { PsiUtil.setModifierProperty(method, PsiModifier.DEFAULT, false); } else if (!method.hasModifierProperty(PsiModifier.STATIC) && !method.isConstructor()) { PsiUtil.setModifierProperty(method, PsiModifier.ABSTRACT, true); } } final PsiField[] fields = anInterface.getFields(); for (final PsiField field : fields) { final PsiModifierList modifierList = field.getModifierList(); if (modifierList != null) { modifierList.setModifierProperty(PsiModifier.PUBLIC, true); modifierList.setModifierProperty(PsiModifier.STATIC, true); modifierList.setModifierProperty(PsiModifier.FINAL, true); } } final PsiClass[] innerClasses = anInterface.getInnerClasses(); for (PsiClass innerClass : innerClasses) { final PsiModifierList modifierList = innerClass.getModifierList(); if (modifierList != null) { modifierList.setModifierProperty(PsiModifier.PUBLIC, true); if (!innerClass.isInterface()) { modifierList.setModifierProperty(PsiModifier.STATIC, true); } } } }