GpsHelper { static boolean isPlayServicesAvailable(final Context context) { try { MethodBuilder methodBuilder = MethodBuilderFactory.create(null, "isGooglePlayServicesAvailable") .setStatic(Class.forName(sPlayServicesUtilClassName)) .addParam(Context.class, context); Object result = methodBuilder.execute(); return (result != null && (Integer) result == GOOGLE_PLAY_SUCCESS_CODE); } catch (Exception exception) { return false; } }  static boolean isLimitAdTrackingEnabled(Context context); static void fetchAdvertisingInfoAsync(final Context context, final GpsHelperListener gpsHelperListener); @Deprecated static void setClassNamesForTesting(); static final int GOOGLE_PLAY_SUCCESS_CODE; static final String ADVERTISING_ID_KEY; static final String IS_LIMIT_AD_TRACKING_ENABLED_KEY; }
@Test public void isPlayServicesAvailable_whenGooglePlayServicesIsNotLinked_shouldReturnFalse() throws Exception { assertThat(GpsHelper.isPlayServicesAvailable(context)).isFalse(); }