@Nullable
  private PsiPackage getTargetPackage() {
    if (myTargetContainer instanceof PsiDirectory directory) {
      return JavaDirectoryService.getInstance().getPackage(directory);
    }
    return null;
  }
@Nullable
  private PsiPackage getTargetPackage()