### Question:
DefaultRouter implements Router { @Override public void initialize() { if (isInitialized()) { return; } try { rwLock.writeLock().lock(); routesByVehicle.clear(); updateRoutingTables(); initialized = true; } finally { rwLock.writeLock().unlock(); } } @Inject  DefaultRouter(TCSObjectService objectService,
                       PointRouterFactory pointRouterFactory,
                       DefaultRouterConfiguration configuration); @Override void initialize(); @Override boolean isInitialized(); @Override void terminate(); @Override @Deprecated void updateRoutingTables(); @Override Set<Vehicle> checkRoutability(TransportOrder order); @Override Optional<List<DriveOrder>> getRoute(Vehicle vehicle,
                                             Point sourcePoint,
                                             TransportOrder transportOrder); @Override Optional<Route> getRoute(Vehicle vehicle,
                                  Point sourcePoint,
                                  Point destinationPoint); @Override long getCosts(Vehicle vehicle,
                       Point sourcePoint,
                       Point destinationPoint); @Override long getCostsByPointRef(Vehicle vehicle,
                                 TCSObjectReference<Point> srcPointRef,
                                 TCSObjectReference<Point> dstPointRef); @Override @Deprecated long getCosts(Vehicle vehicle,
                       TCSObjectReference<Location> srcRef,
                       TCSObjectReference<Location> destRef); @Override void selectRoute(Vehicle vehicle, List<DriveOrder> driveOrders); @Override Map<Vehicle, List<DriveOrder>> getSelectedRoutes(); @Override Set<Point> getTargetedPoints();  }### Answer:
@Test public void shouldUseDefaultRoutingGroup() { createVehicle("Vehicle-000", -1); createVehicle("Vehicle-001", -1); createVehicle("Vehicle-002", -1); router.initialize(); verify(builder, times(1)).createPointRouter(any()); }
@Test public void shouldUseDefinedRoutingGroup() { createVehicle("Vehicle-000", 1); createVehicle("Vehicle-001", 1); createVehicle("Vehicle-002", 1); router.initialize(); verify(builder, times(1)).createPointRouter(any()); }
@Test public void shouldUseDefaultAndSetRoutingGroups() { createVehicle("Vehicle-000", 1); createVehicle("Vehicle-001", 1); createVehicle("Vehicle-002", -1); router.initialize(); verify(builder, times(2)).createPointRouter(any()); }
@Test public void shouldUseSetRoutingGroups() { for (int x = 0; x < 15; x++) { vehicles.add(createVehicle("Vehicle-0" + x, x)); } router.initialize(); verify(builder, times(15)).createPointRouter(any()); }