GoogleGeofenceAdapter implements CTGeofenceAdapter { private GeofencingRequest getGeofencingRequest(ArrayList<Geofence> googleFenceList) { return new GeofencingRequest.Builder() .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER) .addGeofences(googleFenceList) .build(); } GoogleGeofenceAdapter(@NonNull Context context); @SuppressWarnings("unchecked") @WorkerThread @Override void addAllGeofence(@Nullable List<CTGeofence> fenceList,
            @NonNull final OnSuccessListener onSuccessListener); @SuppressWarnings("unchecked") @WorkerThread @Override void removeAllGeofence(@Nullable List<String> fenceIdList,
            @NonNull final OnSuccessListener onSuccessListener); @WorkerThread @Override void stopGeofenceMonitoring(@Nullable final PendingIntent pendingIntent);  }
@Test public void testGetGeofencingRequest() { GoogleGeofenceAdapter geofenceAdapter = new GoogleGeofenceAdapter(application); List<CTGeofence> ctGeofences = CTGeofence.from(GeofenceJSON.getGeofence()); try { List<Geofence> googleGeofences = WhiteboxImpl.invokeMethod(geofenceAdapter, "getGoogleGeofences", ctGeofences); GeofencingRequest geofencingRequest = WhiteboxImpl.invokeMethod(geofenceAdapter, "getGeofencingRequest", googleGeofences); assertEquals(GeofencingRequest.INITIAL_TRIGGER_ENTER, geofencingRequest.getInitialTrigger()); MatcherAssert.assertThat(geofencingRequest.getGeofences(), CoreMatchers.is(googleGeofences)); } catch (Exception e) { e.printStackTrace(); } }