@Test
public void testSetDispatcherFactory() {

    final Matomo matomo = Matomo.getInstance(Robolectric.application);
    Dispatcher dispatcher = mock(Dispatcher.class);
    DispatcherFactory factory = mock(DispatcherFactory.class);
    when(factory.build(any(Tracker.class))).thenReturn(dispatcher);
    assertThat(matomo.getDispatcherFactory(), is(not(nullValue())));
    matomo.setDispatcherFactory(factory);
    assertThat(matomo.getDispatcherFactory(), is(factory));
}