@Test
public void testExecuteTC3() {

    // when pending intent is not null and bgLocationUpdate is false
    CTGeofenceSettings ctGeofenceSettings = new CTGeofenceSettings.Builder()
            .enableBackgroundLocationUpdates(false).build();
    when(ctGeofenceAPI.getGeofenceSettings()).thenReturn(ctGeofenceSettings);
    // make pending intent non-null
    PendingIntent pendingIntent = PendingIntentFactory.getPendingIntent(application,
            PendingIntentFactory.PENDING_INTENT_LOCATION, PendingIntent.FLAG_UPDATE_CURRENT);
    LocationUpdateTask task = new LocationUpdateTask(application);
    task.execute();
    // verify that previous update is removed
    verify(ctLocationAdapter).removeLocationUpdates(any(PendingIntent.class));
    verify(ctLocationAdapter, never()).requestLocationUpdates();
    verifyStatic(Utils.class);
    Utils.writeSettingsToFile(any(Context.class), any(CTGeofenceSettings.class));
}