void (PsiClass originalClass, PsiClass patternClass, PsiClass replacementClass) { if (replacementClass.isEnum() || replacementClass.isAnnotationType() || replacementClass.isInterface()) { return; } if (originalClass.isEnum() && !patternClass.isEnum()) { transform(replacementClass, ClassType.ENUM); } else if (originalClass.isAnnotationType() && !patternClass.isAnnotationType()) { transform(replacementClass, ClassType.ANNOTATION); } else if (originalClass.isInterface() && !patternClass.isInterface()) { transform(replacementClass, ClassType.INTERFACE); } else if (originalClass.isRecord() && !patternClass.isRecord()) { transform(replacementClass, ClassType.RECORD); final PsiRecordHeader recordHeader = originalClass.getRecordHeader(); if (recordHeader != null) { replacementClass.addBefore(recordHeader, replacementClass.getExtendsList()); } } }