@Nullable
  private static PsiPackage getPackage(@NotNull PsiElement element) {
    PsiFile file = element.getContainingFile();
    PsiDirectory directory = file == null ? null : file.getContainingDirectory();
    return directory == null ? null : JavaDirectoryService.getInstance().getPackage(directory);
  }
@Nullable
  private static PsiPackage getPackage(@NotNull PsiElement element)