     }
     
     func testDispatcherMethods() {
-        eventDispatcher = DefaultEventDispatcher()
-        let group = DispatchGroup()
-        
-        group.enter()
-        eventDispatcher?.flushEvents()
-        eventDispatcher?.dispatcher.sync {
-            group.leave()
-        }
-        group.wait()
-        
-        group.enter()
+        eventDispatcher = DefaultEventDispatcher(timerInterval: 1)
+        
+        eventDispatcher?.flushEvents()
+        eventDispatcher?.dispatcher.sync {
+        }
         
         eventDispatcher?.dispatchEvent(event: EventForDispatch(body: Data())) { (result) -> (Void) in
         }
         
         eventDispatcher?.dispatcher.sync {
-            group.leave()
-        }
-        
-        group.wait()
+        }
         
         eventDispatcher?.applicationDidBecomeActive()
-
         eventDispatcher?.applicationDidEnterBackground()
         
         XCTAssert(eventDispatcher?.timer.property == nil)
         var sent = false
+        
+        let group = DispatchGroup()
+        
         group.enter()
         
         eventDispatcher?.sendEvent(event: EventForDispatch(body: Data())) { (result) -> (Void) in

        eventDispatcher = DefaultEventDispatcher( backingStore: .userDefaults)
        let pEventD:OPTEventDispatcher = eventDispatcher!
        eventDispatcher?.timerInterval = 1
        let group = DispatchGroup()
        let enter = { () in
            group.enter()
        }
        let wait = {() in
            self.eventDispatcher?.dispatcher.async {
                group.leave()
            }
            
            group.wait()
        }

        enter()
        
        pEventD.flushEvents()
        
        wait()
        
        enter()
        
        pEventD.dispatchEvent(event: EventForDispatch(body: Data())) { (result) -> (Void) in
            
        }
        
        wait()
        
        XCTAssert(eventDispatcher?.dataStore.count == 1)
        
        enter()
        
        eventDispatcher?.flushEvents()
        
        wait()
        
        XCTAssert(eventDispatcher?.dataStore.count == 0)

        eventDispatcher = DefaultEventDispatcher( backingStore: .file)
        let pEventD:OPTEventDispatcher = eventDispatcher!
        eventDispatcher?.timerInterval = 1
        let wait = {() in
            self.eventDispatcher?.dispatcher.sync {
            }
        }

        pEventD.flushEvents()
        wait()
        
        pEventD.dispatchEvent(event: EventForDispatch(body: Data())) { (result) -> (Void) in
            
        }
        wait()
        
        XCTAssert(eventDispatcher?.dataStore.count == 1)
        
        eventDispatcher?.flushEvents()
        wait()
        
        XCTAssert(eventDispatcher?.dataStore.count == 0)
