assertEquals(new Point(1, 2), rm.getPosition(pack2));
assertEquals(ParcelState.AVAILABLE, model.getParcelState(pack2));
assertEquals(VehicleState.IDLE, model.getVehicleState(truck));
model.pickup(truck, pack2, TimeLapseFactory.create(0, 40));
assertFalse(rm.containsObject(pack2));
final PickupAction action = (PickupAction) model
.getVehicleActionInfo(truck);
assertFalse(action.isDone());
assertEquals(60, action.timeNeeded());
assertEquals(ParcelState.PICKING_UP, model.getParcelState(pack2));
assertEquals(VehicleState.PICKING_UP, model.getVehicleState(truck));
model.continuePreviousActions(truck, TimeLapseFactory.create(0, 40));
assertFalse(action.isDone());
assertEquals(20, action.timeNeeded());
assertEquals(ParcelState.PICKING_UP, model.getParcelState(pack2));
assertEquals(VehicleState.PICKING_UP, model.getVehicleState(truck));
final TimeLapse tl = TimeLapseFactory.create(0, 40);
model.continuePreviousActions(truck, tl);
assertTrue(action.isDone());
assertEquals(0, action.timeNeeded());
assertEquals(20, tl.getTimeLeft());
assertEquals(ParcelState.IN_CARGO, model.getParcelState(pack2));
assertEquals(VehicleState.IDLE, model.getVehicleState(truck));
}