void () { final PsiTypeParameter typeParameter = getTypeParameter(); final PsiReferenceList extendsList = typeParameter.getExtendsList(); final PsiClass cloneableClass = getJavaFacade().findClass("java.lang.Cloneable"); assertNotNull(cloneableClass); final PsiJavaCodeReferenceElement reference = getJavaFacade().getElementFactory().createClassReferenceElement(cloneableClass); ApplicationManager.getApplication().runWriteAction(() -> { extendsList.addBefore(reference, extendsList.getReferenceElements()[0]); }); check(); }