@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)); }
@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 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 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); }
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(); }
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();  }