private static void convertPsiClass(PsiClass aClass, final boolean makeInterface) throws IncorrectOperationException {
    final IElementType lookFor = makeInterface? JavaTokenType.CLASS_KEYWORD : JavaTokenType.INTERFACE_KEYWORD;
    final PsiKeyword replaceWith = JavaPsiFacade.getElementFactory(aClass.getProject()).createKeyword(makeInterface? PsiKeyword.INTERFACE : PsiKeyword.CLASS);
    for (PsiElement psiElement = aClass.getFirstChild(); psiElement != null; psiElement = psiElement.getNextSibling()) {
      if (psiElement instanceof PsiKeyword psiKeyword && psiKeyword.getTokenType() == lookFor) {
        psiKeyword.replace(replaceWith);
        break;
      }
    }
  }
private static void convertPsiClass(PsiClass aClass, final boolean makeInterface)