void (String newPackageName, String fileName, String... classNames) { final PsiElement[] elements = new PsiElement[classNames.length + (fileName != null ? 1 : 0)]; for(int i = 0; i < classNames.length; i++){ String className = classNames[i]; elements[i] = myFixture.findClass(className); } if (fileName != null) { elements[classNames.length] = elements[0].getContainingFile().getContainingDirectory().findFile(fileName); } PsiPackage aPackage = myFixture.findPackage(newPackageName); final PsiDirectory[] dirs = aPackage.getDirectories(); assertEquals(1, dirs.length); final JavaMoveFilesOrDirectoriesHandler handler = new JavaMoveFilesOrDirectoriesHandler(); assertTrue(handler.canMove(elements, dirs[0], null)); handler.doMove(getProject(), elements, dirs[0], null); }