void () { final PsiClass aClass = myJavaFacade.findClass("pack.MyInterface1", GlobalSearchScope.allScope(myProject)); assertNotNull(aClass); final VirtualFile newSourceRoot = aClass.getContainingFile().getVirtualFile().getParent(); replaceSourceRoot(newSourceRoot); assertEquals("MyInterface1", aClass.getName()); }