code: @Override
      public Container getEnclosingContainer() {
          com.ibm.wsspi.artifact.ArtifactContainer parent = delegate.getEnclosingContainer();
          if (parent != null) {
              if (delegate.isRoot()) {
                  //if the delegate has isRoot true, then the enclosingContainer is going to 
                  //be from the next root up.. which means a change of overlay.. 
                  OverlayContainer newOverlay = rootOverlay.getParentOverlay();
                  //the container will be the container the artifact api gives us.
                  ArtifactContainer newDelegateContainer = delegate.getEnclosingContainer();
                  //the adaptable root for the container has to be built, using the new artifactContainer.getRoot, and the parent Overlay.
                  Container newRoot = new AdaptableContainerImpl(newDelegateContainer.getRoot(), newOverlay, factoryHolder);
                  //factoryHolder can stay the same
                  return new AdaptableContainerImpl(newDelegateContainer, newRoot, newOverlay, factoryHolder);
              } else {
                  return new AdaptableContainerImpl(delegate.getEnclosingContainer(), root, rootOverlay, factoryHolder);
              }
          } else
              return null;
      }
docs: {@inheritDoc}