void (String[] classNames, String newPackageName) { final PsiClass[] classes = new PsiClass[classNames.length]; for(int i = 0; i < classes.length; i++){ String className = classNames[i]; classes[i] = myFixture.findClass(className); } PsiPackage aPackage = myFixture.findPackage(newPackageName); assertNotNull("Package " + newPackageName + " not found", aPackage); final PsiDirectory[] dirs = aPackage.getDirectories(GlobalSearchScope.projectScope(getProject())); assertEquals(1, dirs.length); new MoveClassesOrPackagesProcessor(getProject(), classes, new SingleSourceRootMoveDestination(PackageWrapper.create(JavaDirectoryService .getInstance().getPackage(dirs[0])), dirs[0]), true, true, null).run(); }