@Test
public void executeTestTC5() throws Exception {

    // when old geofence is not empty and new geofence list is null
    when(FileUtils.getCachedDirName(application)).thenReturn("");
    when(FileUtils.getCachedFullPath(any(Context.class), anyString())).thenReturn("");
    when(FileUtils.readFromFile(any(Context.class),
            anyString())).thenReturn(GeofenceJSON.getGeofenceString());
    CTGeofenceSettings currentGeofenceSettings = new CTGeofenceSettings.Builder()
            .setGeofenceMonitoringCount(2)
            .build();
    when(ctGeofenceAPI.getGeofenceSettings()).thenReturn(currentGeofenceSettings);
    GeofenceUpdateTask updateTask = new GeofenceUpdateTask(application, null);
    updateTask.execute();
    ArgumentCaptor<JSONObject> argumentCaptorJson = ArgumentCaptor.forClass(JSONObject.class);
    verifyStatic(FileUtils.class);
    FileUtils.writeJsonToFile(any(Context.class), anyString(), anyString(), argumentCaptorJson.capture());
    JSONAssert.assertEquals(GeofenceJSON.getGeofence(), argumentCaptorJson.getValue(), true);
    ArgumentCaptor<List<CTGeofence>> argumentCaptor = ArgumentCaptor.forClass(List.class);
    verify(ctGeofenceAdapter).addAllGeofence(argumentCaptor.capture(), any(OnSuccessListener.class));
    assertEquals(argumentCaptor.getValue().size(), 2);
}