PsiPackage (@NotNull final PsiElement element) { final PsiFile file = element.getContainingFile(); if (file == null) return null; final PsiDirectory directory = file.getContainingDirectory(); if (directory == null) return null; return JavaDirectoryService.getInstance().getPackage(directory); }