/** * Test for changing values in builder. */ @Test public void overridingTest() { final Parcel.Builder b = Parcel.builder(new Point(0, 0), new Point(2, 2)); final IParcel dto1 = b.timeWindows(TimeWindow.create(7, 10)).buildDTO(); assertEquals(TimeWindow.create(7, 10), dto1.getPickupTimeWindow()); assertEquals(TimeWindow.create(7, 10), dto1.getDeliveryTimeWindow()); final IParcel dto2 = b.pickupTimeWindow(TimeWindow.create(8, 11)).buildDTO(); assertEquals(TimeWindow.create(8, 11), dto2.getPickupTimeWindow()); assertEquals(TimeWindow.create(7, 10), dto2.getDeliveryTimeWindow()); final IParcel dto3 = b.serviceDuration(560L).buildDTO(); assertEquals(TimeWindow.create(8, 11), dto3.getPickupTimeWindow()); assertEquals(TimeWindow.create(7, 10), dto3.getDeliveryTimeWindow()); assertEquals(560, dto3.getPickupDuration()); assertEquals(560, dto3.getDeliveryDuration()); final IParcel dto4 = b.pickupDuration(230L).buildDTO(); assertEquals(230, dto4.getPickupDuration()); assertEquals(560, dto4.getDeliveryDuration()); }