@Test
  public void testWriteToBundle_requiresCharging() {
    assertTrue(
        "requiresCharging",
        writer
            .writeToBundle(
                initializeDefaultBuilder().setConstraints(Constraint.DEVICE_CHARGING).build(),
                new Bundle())
            .getBoolean("requiresCharging"));

    for (Integer constraint :
        Arrays.asList(Constraint.ON_ANY_NETWORK, Constraint.ON_UNMETERED_NETWORK)) {

      assertFalse(
          "requiresCharging",
          writer
              .writeToBundle(
                  initializeDefaultBuilder().setConstraints(constraint).build(), new Bundle())
              .getBoolean("requiresCharging"));
    }
  }
Tests for the {@link GooglePlayJobWriter} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/GooglePlayJobWriterTest.java