### Question:
Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)))), () -> null).value()); return values; } Overridden(Optional<DateTime> originalTime, Single<ContentValues> delegate); @Override ContentValues value();  }### Answer:
@Test public void testAbsentWithStartAndDue() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_START, 10); values.put(TaskContract.Instances.INSTANCE_DUE, 20); ContentValues instanceData = new Overridden(absent(), () -> new ContentValues(values)).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, 10)); assertThat(instanceData.size(), is(3)); }
@Test public void testPresent() { ContentValues instanceData = new Overridden(new Present<>(new DateTime(40)), ContentValues::new).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, 40)); assertThat(instanceData.size(), is(1)); }
@Test public void testPresentWithStartAndDue() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_START, 10); values.put(TaskContract.Instances.INSTANCE_DUE, 20); ContentValues instanceData = new Overridden(new Present<>(new DateTime(40)), () -> new ContentValues(values)).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, 40)); assertThat(instanceData.size(), is(3)); }
@Test public void testAbsent() { ContentValues instanceData = new Overridden(absent(), ContentValues::new).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, nullValue(Long.class))); assertThat(instanceData.size(), is(1)); }
@Test public void testAbsentWithStart() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_START, 10); ContentValues instanceData = new Overridden(absent(), () -> new ContentValues(values)).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, 10)); assertThat(instanceData.size(), is(2)); }
@Test public void testAbsentWithDue() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_DUE, 20); ContentValues instanceData = new Overridden(absent(), () -> new ContentValues(values)).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, 20)); assertThat(instanceData.size(), is(2)); }