void (String[] packageNames, String newPackageName) { final PsiPackage[] packages = new PsiPackage[packageNames.length]; for (int i = 0; i < packages.length; i++) { String packageName = packageNames[i]; packages[i] = myFixture.findPackage(packageName); assertNotNull("Package " + packageName + " not found", packages[i]); } performAction(packages, newPackageName); }