@Override
  public boolean isPackage(@NotNull PsiDirectory directory) {
    ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myManager.getProject()).getFileIndex();
    VirtualFile virtualFile = directory.getVirtualFile();
    PackageIndex packageIndex = PackageIndex.getInstance(myManager.getProject());
    return fileIndex.isUnderSourceRootOfType(virtualFile, JavaModuleSourceRootTypes.SOURCES) 
           && packageIndex.getPackageNameByDirectory(virtualFile) != null;
  }
@Override
  public boolean isPackage(@NotNull PsiDirectory directory)