private PsiPackage getParentPackage() {
    Object value = getParentValue();
    return value instanceof PackageElement ? ((PackageElement)value).getPackage() : null;
  }
private PsiPackage getParentPackage()