@Test
 public void testInterfacesWithComponentPointcut() {
   pico.addComponent(Dao.class, DaoImpl.class);
   pico.registerMixin(cuts.component(Dao.class), IdentifiableMixin.class);
   pico.registerInterfaces(cuts.component(Dao.class), new Class[] {AnotherInterface.class});
   Dao dao = pico.getComponent(Dao.class);
   assertTrue(dao instanceof Identifiable);
   assertTrue(dao instanceof AnotherInterface);
 }
  @Test
  public void testComponentMixin() {
    pico.addComponent("hasMixin", DaoImpl.class);
    pico.addComponent("noMixin", DaoImpl.class);

    pico.registerMixin(cuts.component("hasMixin"), IdentifiableMixin.class);

    Dao hasMixin = (Dao) pico.getComponent("hasMixin");
    Dao noMixin = (Dao) pico.getComponent("noMixin");

    verifyMixin(hasMixin);
    verifyNoMixin(noMixin);
    assertTrue(hasMixin instanceof AnotherInterface);
  }
  @Test
  public void testComponentInterceptor() {
    StringBuffer log = new StringBuffer();

    pico.registerInterceptor(
        cuts.component("intercepted"), cuts.allMethods(), new LoggingInterceptor(log));
    pico.addComponent("intercepted", DaoImpl.class);
    pico.addComponent("notIntercepted", DaoImpl.class);

    Dao intercepted = (Dao) pico.getComponent("intercepted");
    Dao notIntercepted = (Dao) pico.getComponent("notIntercepted");

    verifyIntercepted(intercepted, log);
    verifyNotIntercepted(notIntercepted, log);
  }
  @Test
  public void testContainerSuppliedComponentInterceptor() {
    pico.registerInterceptor(
        cuts.component("intercepted"), cuts.allMethods(), LoggingInterceptor.class);

    pico.addComponent("log", StringBuffer.class);
    pico.addComponent(LoggingInterceptor.class);
    pico.addComponent("intercepted", DaoImpl.class);
    pico.addComponent("notIntercepted", DaoImpl.class);

    StringBuffer log = (StringBuffer) pico.getComponent("log");
    Dao intercepted = (Dao) pico.getComponent("intercepted");
    Dao notIntercepted = (Dao) pico.getComponent("notIntercepted");

    verifyIntercepted(intercepted, log);
    verifyNotIntercepted(notIntercepted, log);
  }