### Question:
PermissionUtils { public static boolean isGPSEnabled(Context targetActivity) { LocationManager locationManager = (LocationManager) targetActivity.getSystemService(LOCATION_SERVICE); boolean gpsEnabled = false; if (locationManager != null) { gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); } return gpsEnabled; } private  PermissionUtils(); static boolean isGPSEnabled(Context targetActivity); static void showLocationAlertDialog(Activity targetActivity); static void showAppInfo(Activity targetActivity, String packageName,
                                   String msg, String deniedMsg); static final int APP_SETTING_REQUEST_CODE; }### Answer:
@Test public void locationPermissionTest() { shadowApplication.grantPermissions( Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION); LocationManager locationManager = (LocationManager) application.getSystemService(LOCATION_SERVICE); ShadowLocationManager shadowLocationManager = Shadows.shadowOf(locationManager); shadowLocationManager.setProviderEnabled(LocationManager.GPS_PROVIDER, true); assertTrue(PermissionUtils.isGPSEnabled(application.getApplicationContext())); }