@Test
public void testVisitCountMultipleThreads() throws Exception {

    Tracker tracker = new Tracker(mMatomo, mTrackerBuilder);
    int threadCount = 1000;
    final CountDownLatch countDownLatch = new CountDownLatch(threadCount);
    for (int i = 0; i < threadCount; i++) {
        new Thread(() -> {
            TestHelper.sleep(new Random().nextInt(20 - 0) + 0);
            TrackHelper.track().event("TestCategory", "TestAction").with(new Tracker(mMatomo, mTrackerBuilder));
            countDownLatch.countDown();
        }).start();
    }
    countDownLatch.await();
    assertEquals(threadCount, mTrackerPreferences.getLong(Tracker.PREF_KEY_TRACKER_VISITCOUNT, 0));
}