private void setNetworkMetered(boolean isMetered) {
    // Only mobile connections are considered to be metered.
    // See {@link ShadowConnectivityManager#isActiveNetworkMetered()}
    if (isMetered) {
      shadowNetworkInfo.setConnectionType(ConnectivityManager.TYPE_MOBILE);
    } else {
      shadowNetworkInfo.setConnectionType(ConnectivityManager.TYPE_WIFI);
    }
  }
Tests for the {@link com.firebase.jobdispatcher.ConstraintChecker} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/ConstraintCheckerTest.java