### Question:
RerouteUtil { public DriveOrder mergeDriveOrders(DriveOrder orderA, DriveOrder orderB, Vehicle vehicle) { Route mergedRoute = mergeRoutes(vehicle, orderA.getRoute(), orderB.getRoute()); DriveOrder mergedOrder = new DriveOrder(orderA.getDestination()) .withState(orderA.getState()) .withTransportOrder(orderA.getTransportOrder()) .withRoute(mergedRoute); return mergedOrder; } @Inject  RerouteUtil(Router router,
                     VehicleControllerPool vehicleControllerPool,
                     InternalTransportOrderService transportOrderService,
                     DefaultDispatcherConfiguration configuration); void reroute(Vehicle vehicle); List<DriveOrder> getUnfinishedDriveOrders(TransportOrder order); DriveOrder mergeDriveOrders(DriveOrder orderA, DriveOrder orderB, Vehicle vehicle); Optional<List<DriveOrder>> tryReroute(List<DriveOrder> driveOrders,
                                               Vehicle vehicle,
                                               Point sourcePoint); List<Step> getFutureSteps(Vehicle vehicle); Point getFutureOrCurrentPosition(Vehicle vehicle); boolean routesEquals(List<DriveOrder> ordersA, List<DriveOrder> ordersB);  }### Answer:
@Test public void shouldMergeDriveOrders() { DriveOrder orderA = createDriveOrder(10, "A", "B", "C", "D", "E", "F", "G"); DriveOrder orderB = createDriveOrder(10, "D", "H", "I", "J"); when(router.getCosts(any(Vehicle.class), any(Point.class), any(Point.class))).thenReturn(20L); Route expected = createDriveOrder(20, "A", "B", "C", "D", "H", "I", "J").getRoute(); Route actual = rerouteUtil.mergeDriveOrders(orderA, orderB, new Vehicle("Vehicle")).getRoute(); assertEquals(expected, actual); }