@Test
public void testDeactivate() {

    CTGeofenceAPI ctGeofenceAPI = CTGeofenceAPI.getInstance(application);
    CTGeofenceTaskManager.getInstance().setExecutorService(executorService);
    ctGeofenceAPI.deactivate();
    ArgumentCaptor<Runnable> argumentCaptor = ArgumentCaptor.forClass(Runnable.class);
    verify(executorService).submit(argumentCaptor.capture());
    PendingIntent geofenceMonitoring = PendingIntentFactory.getPendingIntent(application,
            PendingIntentFactory.PENDING_INTENT_GEOFENCE, FLAG_UPDATE_CURRENT);
    PendingIntent locationUpdates = PendingIntentFactory.getPendingIntent(application,
            PendingIntentFactory.PENDING_INTENT_LOCATION, FLAG_UPDATE_CURRENT);
    argumentCaptor.getValue().run();
    verify(geofenceAdapter).stopGeofenceMonitoring(geofenceMonitoring);
    verify(locationAdapter).removeLocationUpdates(locationUpdates);
    PowerMockito.verifyStatic(FileUtils.class);
    FileUtils.deleteDirectory(any(Context.class), FileUtils.getCachedDirName(application));
    assertFalse(ctGeofenceAPI.isActivated());
}