public void setUp() {
    index = 0;

    EventDispatcher eventDispatcher = new RunnableEventDispatcher();

    syncManager = new MockSyncManager(eventDispatcher, 20);
    settingsStore = new MockKeyValueStore();
    contactsStore = new MockDataStore();
    contentSinkAndSource = new MockSinkAndSource(20);
    protocol =
        new MockCommunicationManager(
            20,
            new byte[] {ServiceObject.ACTIVITY},
            new int[] {ServerRequest.GET},
            new int[] {ServerRequest.ACTIVITIES});
    emailProtocol = new MockEmailCommunicationManager();

    context =
        new MockMIDlet(
            settingsStore,
            contactsStore,
            new MockDataStore(),
            new MockDataStore(),
            syncManager,
            contentSinkAndSource,
            contentSinkAndSource,
            protocol,
            emailProtocol,
            eventDispatcher,
            20);

    model = context.getModel();
    model.attach(this);
  }