### Question:
RerouteUtil { public List<Step> getFutureSteps(Vehicle vehicle) { TCSObjectReference<TransportOrder> orderRef = vehicle.getTransportOrder(); if (orderRef == null) { LOG.debug("Vehicle {} isn't processing any order. Can't determine future steps.", vehicle.getName()); return new ArrayList<>(); } TransportOrder order = transportOrderService.fetchObject(TransportOrder.class, orderRef); VehicleController controller = vehicleControllerPool.getVehicleController(vehicle.getName()); List<Step> currentSteps = order.getCurrentDriveOrder().getRoute().getSteps(); if (!controller.getCommandsSent().isEmpty()) { List<MovementCommand> commandsSent = new ArrayList<>(controller.getCommandsSent()); MovementCommand lastCommandSent = commandsSent.get(commandsSent.size() - 1); currentSteps = currentSteps.subList( currentSteps.indexOf(lastCommandSent.getStep()) + 1, currentSteps.size()); } List<Step> futureSteps = new ArrayList<>(); futureSteps.addAll(currentSteps); order.getFutureDriveOrders().stream() .map(driveOrder -> driveOrder.getRoute()) .map(route -> route.getSteps()) .forEach(steps -> futureSteps.addAll(steps)); return futureSteps; } @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 shouldReturnFutureSteps() { List<DriveOrder> driveOrders = Arrays.asList(createDriveOrder(10, "A", "B", "C"), createDriveOrder(20, "C", "D", "E", "F", "G", "H"), createDriveOrder(20, "H", "I", "J", "K", "L")); TransportOrder transportOrder = new TransportOrder("TransportOrder", driveOrders) .withCurrentDriveOrderIndex(1); Vehicle vehicle = new Vehicle("Vehicle") .withTransportOrder(transportOrder.getReference()); VehicleController controller = mock(VehicleController.class); when(transportOrderService.fetchObject(TransportOrder.class, transportOrder.getReference())) .thenReturn(transportOrder); when(vehicleControllerPool.getVehicleController(vehicle.getName())).thenReturn(controller); when(controller.getCommandsSent()).thenReturn(commandsSentToVehicle(driveOrders)); List<String> expected = Arrays.asList("H", "I", "J", "K", "L"); List<String> actual = rerouteUtil.getFutureSteps(vehicle).stream() .map(step -> step.getDestinationPoint().getName()) .collect(Collectors.toList()); assertEquals(expected, actual); }