@Test
public void executeTestTC4() throws Exception {

    // when old geofence is not empty and new geofence list is not empty
    when(FileUtils.getCachedDirName(application)).thenReturn("");
    when(FileUtils.getCachedFullPath(any(Context.class), anyString())).thenReturn("");
    when(FileUtils.readFromFile(any(Context.class),
            anyString())).thenReturn(GeofenceJSON.getFirst().toString());
    CTGeofenceSettings currentGeofenceSettings = new CTGeofenceSettings.Builder()
            .setGeofenceMonitoringCount(1)
            .build();
    when(ctGeofenceAPI.getGeofenceSettings()).thenReturn(currentGeofenceSettings);
    GeofenceUpdateTask updateTask = new GeofenceUpdateTask(application, GeofenceJSON.getGeofence());
    updateTask.execute();
    ArgumentCaptor<List<String>> argumentCaptorOldGeofence = ArgumentCaptor.forClass(List.class);
    verify(ctGeofenceAdapter)
            .removeAllGeofence(argumentCaptorOldGeofence.capture(), any(OnSuccessListener.class));
    assertThat(argumentCaptorOldGeofence.getValue(), is(Arrays.asList(new String[]{"310001"})));
}