@Override
  protected void tearDown() throws Exception {
    if (myTransport != null) {
      myTransport.dispose();
      Pico.getInstance().unregisterComponentByInstance(myTransport);
    }

    StringUtil.setMyUsername(null);
    super.tearDown();
  }
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myUserModel = new UserModelImpl(getBroadcaster());
    disposeOnTearDown(myUserModel);
    myIdeFacade = new MockIDEFacade(getClass());
    myIdeFacade.setReturnedProjects(new String[] {PROJECT_NAME});

    myDispatcher = new AsyncMessageDispatcherImpl(getBroadcaster(), myIdeFacade);
    disposeOnTearDown(myDispatcher);
    myTransport =
        new P2PTransport(myDispatcher, myUserModel, WAIT_USER_RESPONSES_TIMEOUT) {
          @Override
          protected void sendUserAddedCallback(User user) {
            super.sendUserAddedCallback(user);
            myLog += "sendUserAddedCallback" + user;
          }
        };
    Pico.getInstance().registerComponentInstance(myTransport);

    myLog = "";
    myProjectLevelContainer = Pico.getInstance().makeChildContainer();
  }
 public static JabberTransport getInstance() {
   return (JabberTransport) Pico.getInstance().getComponentInstanceOfType(JabberTransport.class);
 }