code: @SuppressWarnings("squid:S2259") // potential multi-threading NPE
    public Package getRootPackage() {
      Package aPackage = this;
      while (aPackage.getParent() != null) {
        aPackage = aPackage.getParent();
      }
      return aPackage;
    }
docs: Get the root of this package, or itself if this is a root package
  
  @return root package of this package or <tt>null</tt>