    001    package org.nanocontainer.script;
    002
    003    import org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer;
    004    import org.picocontainer.MutablePicoContainer;
    005    import org.picocontainer.ComponentAdapter;
    006    import org.picocontainer.PicoRegistrationException;
    007    import org.picocontainer.Parameter;
    008
    009    import java.util.HashMap;
    010    import java.util.ArrayList;
    011
    012    import junit.framework.Assert;
    013
    014    public class FooDecoratingPicoContainer extends AbstractDelegatingMutablePicoContainer {
    015        public FooDecoratingPicoContainer(MutablePicoContainer delegate) {
    016            super(delegate);
    017        }
    018        public MutablePicoContainer makeChildContainer() {
    019            return null;
    020        }
    021
    022        public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoRegistrationException {
    023            Assert.assertEquals(HashMap.class, componentImplementation);
    024            return super.registerComponentImplementation(ArrayList.class, ArrayList.class, parameters);
    025        }
    026        public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException {
    027            Assert.assertEquals(HashMap.class, componentImplementation);
    028            return super.registerComponentImplementation(ArrayList.class, ArrayList.class);
    029        }
    030
    031    }