code: @SuppressWarnings("unchecked")
      @Override
      public <T> T adapt(Class<T> adaptTarget) throws UnableToAdaptException {
          //intercept the adapt to container, to return interpreted.
          if (adaptTarget.equals(Container.class)) {
              ArtifactContainer c = delegate.convertToContainer();
              if (c != null) {
                  if (c.isRoot()) {
                      //c is a new root, need to switch the overlay passed.
                      OverlayContainer newOverlay = rootOverlay.getOverlayForEntryPath(delegate.getPath());
                      //Structure helpers can only make non-roots into roots
                      //they cannot make roots into non-roots.
                      //
                      //we have just encountered an artifact root, so this WILL
                      //be a new adaptable root. 
                      //
                      //we swap to using..
                      // - the new overlay for the new root
                      // - this InterpretedContainer becomes root (omit passing the 2nd arg 'root')
                      // - pass null as the structureHelperLocalRootDelegate, because the roots align again.
                      //
                      return (T) new InterpretedContainerImpl(c, newOverlay, factoryHolder, structureHelper, null);
                  } else {
                      //the new artifact container may or may not be a structure helper declared root
                      //this doesnt matter here.
                      //we don't need to reconfigure the structureHelperLocalRootDelegate, as the interpreted container
                      //does that in its constructor.
                      return (T) new InterpretedContainerImpl(c, root, rootOverlay, factoryHolder, structureHelper, structureHelperLocalRootDelegate);
                  }
              }
          }
          return super.adapt(adaptTarget);
      }
docs: {@inheritDoc}