### Question:
Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, due) -> due - start), () -> null).value()); return values; } Enduring(Single<ContentValues> delegate); @Override ContentValues value();  }### Answer:
@Test public void testNoValue() { assertThat(new Enduring(ContentValues::new), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, nullValue(Long.class)))); assertThat(new Enduring(ContentValues::new).value().size(), is(1)); }
@Test public void testStartValue() { ContentValues values = new ContentValues(1); values.put(TaskContract.Instances.INSTANCE_START, 10); assertThat(new Enduring(() -> new ContentValues(values)), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, nullValue(Long.class)))); assertThat(new Enduring(() -> new ContentValues(values)).value().size(), is(2)); }
@Test public void testDueValue() { ContentValues values = new ContentValues(1); values.put(TaskContract.Instances.INSTANCE_DUE, 10); assertThat(new Enduring(() -> new ContentValues(values)), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, nullValue(Long.class)))); assertThat(new Enduring(() -> new ContentValues(values)).value().size(), is(2)); }
@Test public void testStartDueValue() { ContentValues values = new ContentValues(2); values.put(TaskContract.Instances.INSTANCE_START, 1); values.put(TaskContract.Instances.INSTANCE_DUE, 10); assertThat(new Enduring(() -> new ContentValues(values)), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, 9))); assertThat(new Enduring(() -> new ContentValues(values)).value().size(), is(3)); }